viike, lede=[int(s) for s in input().split(" ")] ledid=[[int(s) for s in input().split(" ")] for nr in range(lede)] print(ledid) sobivad=[] for nr in range(2**viike): muster=bin(nr)[2:] muster=("0"*(1+viike-len(muster))+muster) print(muster) v=[paar for paar in ledid if ((muster[paar[0]]=='1') and (muster[paar[1]]=='0'))] if(len(v)==1): sobivad.append(v[0]) print(sobivad) for paar in ledid: print("JAH" if paar in sobivad else "EI")