Problem A
Triple Sevens
Eddy is overseeing construction of some new slot machines.
His slot machines consist of three wheels, each of which can
show one of several different digits. When activated, each
wheel shows a random digit. The goal is for all wheels to be
able to show the digit
A slot machine is good if each wheel is capable of showing
the digit
Input
The first line contains a single integer
Each of the next three lines contains
Output
Output a single integer, which is
Sample Input 1 | Sample Output 1 |
---|---|
2 0 7 7 3 7 0 |
777 |
Sample Input 2 | Sample Output 2 |
---|---|
2 0 7 7 3 3 9 |
0 |