n= int(input()) response = {input() for line in range(n)} NO = set("".join([i for i in response if i[-2:] == "NO"])) YES = response - NO print("".join(set("0123456789") - (NO | (NO & YES))))