P3034 [USACO11DEC] Cow Photography G/S

Description

The cows are in a particularly mischievous mood today! All Farmer John wants to do is take a photograph of the cows standing in a line, but they keep moving right before he has a chance to snap the picture. Specifically, each of FJ's N (1

Input Format

\* Line 1: The number of cows, N (1

Output Format

\* Lines 1..N: The intended ordering A, one ID per line.

Explanation/Hint

There are 5 cows, with IDs 10, 20, 30, 40, and 50. In each of the 5 photos, a different cow moves to the front of the line (at most one cow moves in each photo here, but it is possible in other inputs that multiple cows could move in a particular photo). The correct original ordering A[1..5] is 10, 20, 30, 40, 50.