Codeforces Round 459 (Div. 2)


A. Eleven
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8
Output
OOOoOooO
Input
15
Output
OOOoOooOooooOoo
----------------------------------------------------------------------------------------------------
B. Radio Station
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2
main 192.168.0.2
replica 192.168.0.1
block 192.168.0.1;
proxy 192.168.0.2;
Output
block 192.168.0.1; #replica
proxy 192.168.0.2; #main
Input
3 5
google 8.8.8.8
codeforces 212.193.33.27
server 138.197.64.57
redirect 138.197.64.57;
block 8.8.8.8;
cf 212.193.33.27;
unblock 8.8.8.8;
check 138.197.64.57;
Output
redirect 138.197.64.57; #server
block 8.8.8.8; #google
cf 212.193.33.27; #codeforces
unblock 8.8.8.8; #google
check 138.197.64.57; #server
----------------------------------------------------------------------------------------------------
C. The Monster
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
((?))
Output
4
Input
??()??
Output
7
----------------------------------------------------------------------------------------------------
D. MADMAX
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4
1 2 b
1 3 a
2 4 c
3 4 b
Output
BAAA
ABAA
BBBA
BBBB
Input
5 8
5 3 h
1 2 c
3 1 c
3 2 r
5 1 r
4 3 z
5 4 r
5 2 h
Output
BABBB
BBBBB
AABBB
AAABA
AAAAB
----------------------------------------------------------------------------------------------------
E. Pollywog
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3 10 2
1 2 3
5 -10
6 1000
Output
6
Input
4 7 85 3
17 5 28 4 52 46 6
59 -76
33 -69
19 2018
Output
135
----------------------------------------------------------------------------------------------------
