A playlist is a row of n track codes. You want to demote every copy of one specific code x to the very end of the playlist, while every other track keeps its original relative order. Output the resulting playlist. (All the demoted copies of x sit together at the end.)
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the track codes in order.
Line 3: an integer x, the code to demote.
Output format
One line: the n track codes after moving every x to the end, space-separated.
Constraints
- 1 ≤ n ≤ 100000
- -1000000000 ≤ each track code ≤ 1000000000
- -1000000000 ≤ x ≤ 1000000000