Two-dimensional electron gas in a strong magnetic field. I