def fx(): X=input().split()[0] pa=input().split() pb=input().split() n=(X in pa)+(X in pb)*2 return [-1,"MrMax","MaxValu","MrMaxValu"][n] print(fx())