Peculiarities of acoustic-gravity waves in inhomogeneous flows of the polar thermosphere