SP15574 STC07 - Railway
Description
A railroad siding consists of two (dead-end) sidetracks 1 and 2. The siding is entered by track A, and left by track B.
There are N cars on track A, numbered from 1 to N. They are arranged in such a way that they enter the siding in the order a $ _{1} $ , a $ _{2} $ , a $ _{3} $ , ..., a $ _{N} $ . The cars are to be transferred to the siding, so that they leave it by track B in the order 1, 2, 3, ..., N. Each car is to be transferred once from track A to one of the sidetracks 1 or 2, and later (possibly after some transfers of the remaining cars) once from that sidetrack to the track B. The sidetracks are long enough to store even the longest trains, so there is no need to worry about their capacity.
Input
-----
The first line of the standard input holds one integer N (1
Input Format
N/A
Output Format
N/A