Codeforces Round 434 (Div. 1, based on Technocup 2018 Elimination Round 1)


A. Did you mean...
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
hellno
Output
hell no 
Input
abacaba
Output
abacaba 
Input
asdfasdf
Output
asd fasd f 
----------------------------------------------------------------------------------------------------
B. Polycarp's phone book
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
123456789
100000000
100123456
Output
9
000
01
Input
4
123456789
193456789
134567819
934567891
Output
2
193
81
91
----------------------------------------------------------------------------------------------------
C. Tests Renumeration
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
01 0
2 1
2extra 0
3 1
99 0
Output
4
move 3 1
move 01 5
move 2extra 4
move 99 3
Input
2
1 0
2 1
Output
3
move 1 3
move 2 1
move 3 2
Input
5
1 0
11 1
111 0
1111 1
11111 0
Output
5
move 1 5
move 11 1
move 1111 2
move 111 4
move 11111 3
----------------------------------------------------------------------------------------------------
D. Wizard's Tour
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 5
1 2
3 2
2 4
3 4
4 1
Output
2
1 4 2
4 3 2
Input
5 8
5 3
1 2
4 5
5 1
2 5
4 3
1 4
3 2
Output
4
1 4 5
2 3 4
1 5 3
5 2 1
----------------------------------------------------------------------------------------------------
E. Arkady and a Nobody-men
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
0 1 2 1
Output
0 2 4 2 
Input
5
2 3 4 5 0
Output
10 6 3 1 0 
Input
5
0 1 1 1 3
Output
0 3 3 3 5 
----------------------------------------------------------------------------------------------------
