Dynamics of hydromagnetic clouds from powerful solar flares