All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
How to get out of the row should be an easy matter that does not require effort. If the person moves out of the row, it is permissible for the person who is behind him to advance to fill the gap which he leaves. If he moves to fill the gap, then the person behind him moves to fill the gap and so forth.
If the person who wants to leave the row is unable to pass when the worshippers are standing, he may pass through them when they are in prostration. Usually the worshippers make way for such a person to get out, especially if they see him holding his nose thinking that his nose is bleeding.
For more benefit, please refer to Fatwa 92305.
Allaah Knows best.