Magic Order

Write a digit from 1 to 5 in every cell. Digits in the same row and column are all different. Reading these digits from left to right, from right to left, from top to bottom, and from bottom to top forms twenty different 5-digit numbers. Clues before the number give their position in an ascending order.

This is rather nasty for such a small grid.

EDIT: fixed