Solutions
Sway in the rigid frame can be predicted either by computing the moment of resistance or by analysis.
Method 1: Analysis by computing Moment of Resistance
There are two columns in the frame i.e. AB and CD
For the column AB ⇒ Moment of resistance against deformation = 

For the column CD ⇒ Moment of resistance against deformation = 

∵ Since both the columns have the same moment of resistance, the direction of sway cannot be predicted.
Method 2: Practical Analysis
Let’s divide the frame into two different portions, along the center line i.e. symmetrically.

Since the left portion of the frame doesn’t carry any external load, it’s kept out of the analysis. Taking the right side of the frame.

Assume Frame sways in the right direction,

But right sway would lead the rigid joint to form an acute angle between the two members, which is not possible.
Now, assume sway in the left direction,

Yes, left sway would maintain the right angle between the two members.
∴ The frame will sway in the left direction.