제출 #801863

#제출 시각아이디문제언어결과실행 시간메모리
801863Trisanu_DasElder (COCI19_elder)Pypy 3
50 / 50
34 ms18240 KiB
w = input()
n = int(input())
o = {w}
for i in range(n):
    ww, l = input().split()
    if l == w:
        w = ww
        o.add(w)
print(w)
print(len(o))
#Verdict Execution timeMemoryGrader output
Fetching results...