n, readline = int(input()), lambda l: l.split() response = (readline(input()) for line in range(n)) NO = set(" ".join(filter(lambda x: x[4] == "NO", response)).split()) YES = set(" ".join(filter(lambda x: x[4] == "YES", response)).split()) print(set(range(10)) - (NO + (NO ^ YES)))