e-olymp
Problems

Frame-workout 1

Frame-workout 1

Replace thearray elementsaccording to theassignment.

Input

In the inputfileis writtenfirst,the numberN (1N100), andthenNnumbersfrom1 to 100 - the array elements A[i]. Further,recordedtwonumbersqandw (from 1toN,not necessarily distinct).

Requiresall the elementsthatare equal toA[q],made ​​equal toA[w].Tryfirstto read the data,thendowhatyou want,and thendisplay the result(instead of doingthe conversionon theoutputstage).Trynotto usedopolnitelnymiarrays.

Output

The outputfileoutputNnumbers-the array elementsA[i]afterthe conversion.

Time limit 1 second
Memory limit 64 MiB
Input example #1
5
1 4 2 2 5
3 2
Output example #1
1 4 4 4 5