  We present a three-dimensional analysis of a sample of 22 859 type $ab$ RR
Lyrae stars in the Magellanic System from the OGLE-IV Collection of RR Lyrae
stars. The distance to each object was calculated based on its photometric
metallicity and a theoretical relation between color, absolute magnitude and
metallicity.
  The LMC RR Lyrae distribution is very regular and does not show any
substructures. We demonstrate that the bar found in previous studies may be an
overdensity caused by blending and crowding effects. The halo is asymmetrical
with a higher stellar density in its north-eastern area, which is also located
closer to us. Triaxial ellipsoids were fitted to surfaces of a constant number
density. Ellipsoids farther from the LMC center are less elongated and slightly
rotated toward the SMC. The inclination and position angle change significantly
with the $a$ axis size. The median axis ratio is $1:1.23:1.45$.
  The RR Lyrae distribution in the SMC has a very regular, ellipsoidal shape
and does not show any substructures or asymmetries. All triaxial ellipsoids
fitted to surfaces of a constant number density have virtually the same shape
(axis ratio) and are elongated along the line of sight. The median axis ratio
is $1:1.10:2.13$. The inclination angle is very small and thus the position
angle is not well defined.
  We present the distribution of RR Lyrae stars in the Magellanic Bridge area,
showing that the Magellanic Clouds' halos overlap.
  A comparison of the distributions of RR Lyrae stars and Classical Cepheids
shows that the former are significantly more spread and distributed regularly,
while the latter are very clumped and form several distinct substructures.
