ACROPOLIS
The Acropolis of Athens is, if not the most important, one of the most important creations of humanity. The construction of the Acropolis, from conception, design, study, construction, and the creation of its eternal sculptures, reveals the greatness of Greek civilization.
One of the many problems that the Ancient Greeks had to face was the elevation of the marbles on the sacred rock. To achieve this, they used a system with pulleys, so that when an empty cart descended, it was used as a counterweight for the ascending one. For the better achievement of this purpose, it was preferable for the lighter carts to ascend first.
However, during the creation of the sculptures of the Parthenon's facade, some separate pieces of Pentelic marble had to be transported directly and in a specific order. These pieces were small and practically of low weight (indicative weight ).
Your task is to create a program that will help our ancestors plan the sequence of transporting the loads. The weights with the indicative value correspond to these separate pieces of marble that need to be transported in the given order of appearance.
Input Files:
The input files named acropolis.in are text files with the following structure: The first line contains an integer N, where , which represents the number of loads to be transported. The next lines () contain the weights of the loads, expressed as an integer B, where . Loads with must be transported in the order of appearance.
Output Files:
The output files named acropolis.out are text files with the following structure: They have exactly lines, where each line contains a weight value , and the order of appearance of the weights in the lines indicates the order of their transportation.
Examples of Input - Output Files:
1ο
STDIN (acropolis.in)
10
1740
532
9000
1
8500
4000
5000
2120
777
8999
STDOUT (acropolis.out)
532
777
1740
1
2120
4000
5000
8500
8999
9000
2ο
STDIN (acropolis.in)
9
7791
1
1
1
1
1
1
1
614
STDOUT (acropolis.out)
614
1
1
1
1
1
1
1
7791
Εxecution time sec.
Comments