eolymp
bolt
Try our new interface for solving problems
Problems

Double reverse

Double reverse

Time limit 1 second
Memory limit 122 MiB

Given a sequence of positive integers 1, 2, 3, ..., n. Arrange first in reverse order the part of this sequence starting from the element with number a to the element with number b, and then reverse the subsequence starting from element with number c to the element with number d.

Input data

Given the integers n (1n1000), a, b, c, d (a < b, c < d, 1a, b, c, d1000)..

Output data

Print the resulting sequence.

Examples

Input example #1
9 2 5 6 9
Output example #1
1 5 4 3 2 9 8 7 6
Input example #2
9 3 6 5 8
Output example #2
1 2 6 5 8 7 3 4 9