The causes of thermospheric composition variations during and after major geomagnetic storms