Codeforces Beta Round 73 (Div. 2 Only)


A. Chord
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
C E G
Output
major
Input
C# B F
Output
minor
Input
A B H
Output
strange
----------------------------------------------------------------------------------------------------
B. Keyboard
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 1
ab
cd
1
A
Output
-1
Input
2 2 1
ab
cd
1
e
Output
-1
Input
2 2 1
ab
cS
5
abcBA
Output
1
Input
3 9 4
qwertyuio
asdfghjkl
SzxcvbnmS
35
TheQuIcKbRoWnFOXjummsovertHeLazYDOG
Output
2
----------------------------------------------------------------------------------------------------
C. Trains
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 7
Output
Dasha
Input
5 3
Output
Masha
Input
2 3
Output
Equal
----------------------------------------------------------------------------------------------------
D. Vasya and Types
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
typedef void* ptv
typeof ptv
typedef &&ptv node
typeof node
typeof &ptv
Output
void*
errtype
void
Input
17
typedef void* b
typedef b* c
typeof b
typeof c
typedef &b b
typeof b
typeof c
typedef &&b* c
typeof c
typedef &b* c
typeof c
typedef &void b
typeof b
typedef b******* c
typeof c
typedef &&b* c
typeof c
Output
void*
void**
void
void**
errtype
void
errtype
errtype
errtype
----------------------------------------------------------------------------------------------------
E. Interesting Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
Output
2
Input
6
Output
-1
Input
100
Output
8
----------------------------------------------------------------------------------------------------
