Codeforces Beta Round 19


A. World Football Cup
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
4
A
B
C
D
A-B 1:1
A-C 2:2
A-D 1:0
B-C 1:0
B-D 0:3
C-D 0:3
Output
A
D
Input
2
a
A
a-A 2:1
Output
a
----------------------------------------------------------------------------------------------------
B. Checkout Assistant
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2 10
0 20
1 5
1 3
Output
8
Input
3
0 1
0 10
0 100
Output
111
----------------------------------------------------------------------------------------------------
C. Deletion of Repeats
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
1 2 3 1 2 3
Output
3
1 2 3 
Input
7
4 5 6 5 6 7 7
Output
1
7 
----------------------------------------------------------------------------------------------------
D. Points
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
add 1 1
add 3 4
find 0 0
remove 1 1
find 0 0
add 1 1
find 0 0
Output
1 1
3 4
1 1
Input
13
add 5 5
add 5 6
add 5 7
add 6 5
add 6 6
add 6 7
add 7 5
add 7 6
add 7 7
find 6 6
remove 7 7
find 6 6
find 4 4
Output
7 7
-1
5 5
----------------------------------------------------------------------------------------------------
E. Fairy
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4
1 2
1 3
2 4
3 4
Output
4
1 2 3 4 
Input
4 5
1 2
2 3
3 4
4 1
1 3
Output
1
5 
----------------------------------------------------------------------------------------------------
