No.975 Mister Max Valu
Problem Statement
In the country where Apoi lives, the state manages products by assigning the same number to identical products.
Now, this country has two kinds of stores, Mister Max and MaxValu, but Apoi cannot tell the difference between Mister Max and MaxValu.
The item $X$ that Apoi wants and the lists of products sold at Mister Max and MaxValu are given as described below.
If the item Apoi wants is available only at Mister Max, output "MrMax"; if it is available only at MaxValu, output "MaxValu".
Otherwise, if it is available at both, output "MrMaxValu", and if it is available at neither, output "-1".
Input
$X$ $N$ $M$ $A_1\ A_2\ \dots\ A_N$ $B_1\ B_2\ \dots\ B_M$
The first line contains the number $X$ of the product Apoi wants, the number $N$ of products sold at Mister Max, and the number $M$ of products sold at MaxValu, separated by single-byte spaces.
The second line contains the list of the numbers of the $N$ products sold at Mister Max, separated by single-byte spaces. The $A_i$ are pairwise distinct.
The third line contains the list of the numbers of the $M$ products sold at MaxValu, separated by single-byte spaces. The $B_i$ are pairwise distinct.
$1\le X,N,M,A_i,B_j \le 10^5 \ (1 \le i \le N, 1 \le j \le M)$
Disclaimer
This problem has no connection whatsoever with either Mister Max or MaxValu.
Output
If the item Apoi wants is available only at Mister Max, output "MrMax"; if it is available only at MaxValu, output "MaxValu".
Otherwise, if it is available at both, output "MrMaxValu", and if it is available at neither, output "-1".
Print a newline at the end.
Sample
Sample 1
Input
114 5 8 1 3 4 9 12 2 3 11 18 114 514 364 1919
Output
MaxValu
Product 114 is on MaxValu's product list, so output "MaxValu".
Sample 2
Input
2525 1 1 2525 2525
Output
MrMaxValu
Both are specialty stores for product 2525, so output "MrMaxValu".
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Apoi
りあん