Codeforces Round 281 (Div. 2)


A. Vasya and Football
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
MC
CSKA
9
28 a 3 y
62 h 25 y
66 h 42 y
70 h 25 y
77 a 4 y
79 a 25 y
82 h 42 r
89 h 16 y
90 a 13 r
Output
MC 25 70
MC 42 82
CSKA 13 90
----------------------------------------------------------------------------------------------------
B. Vasya and Wrestling
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1
2
-3
-4
3
Output
second
Input
3
-1
-2
3
Output
first
Input
2
4
-4
Output
second
----------------------------------------------------------------------------------------------------
C. Vasya and Basketball
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
2
5 6
Output
9:6
Input
5
6 7 8 9 10
5
1 2 3 4 5
Output
15:10
----------------------------------------------------------------------------------------------------
D. Vasya and Chess
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
Output
white
1 2
Input
3
Output
black
----------------------------------------------------------------------------------------------------
E. Vasya and Polynomial
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 2
Output
2
Input
2 3 3
Output
1
----------------------------------------------------------------------------------------------------
