Z. Archaeological Recovery
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
2 3 4
EEE 1
EIA 1
IAE 1
AAA 1
Output
+++
+-0
Input
3 2 2
IA 4
AA 4
Output
00
00
-0