Harryxun/stf_run huggingface dataset:
from copy import deepcopy
N, u, v = map(int, input().split())
edge = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    edge[a].append(b)
    edge[b].append(a)

aoki = [0] * N
takahasi = [0] * N
dist_list = [0] * N
def dfs(pv, v, dist):
    dist_list[v] = dist
    for nv in edge[v]:
        if nv == pv:
            continue
        dfs(v, nv, dist+1)

dfs(-1,u-1,0)
takahasi = deepcopy(dist_list)
dist_list = [0] * N
dfs(-1,v-1,0)
aoki = deepcopy(dist_list)
print(takahasi)
print(aoki)



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N, u, v = map(int, input().split())
u, v = u-1, v-1
edge = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    edge[a].append(b)
    edge[b].append(a)

taka = [0] * N
aoki = [0] * N

def dfs(v, pre, cost, i):
    for e in edge[v]:
        if e == pre:
            continue
        cost = dfs(e, v, cost, i+1)
    cost[v] = i
    return cost

taka = dfs(u, -1, [0] * N, 0)
aoki = dfs(v, -1, [0] * N, 0)

m = 0
for i in range(N):
    if taka[i] < aoki[i]:
        m = max(m, aoki[i])

print(m-1)
count = 0
before = 0
if k%2 == 0 or k%5==0:
    print(-1)
    exit()

ai=0
i=0
while True:
    ai = (ai*10+7)%k
    i += 1
    if ai == 0:
        print(i)
        break

### FIXED CODE ###

k = int(input())
count = 0
before = 0
if k % 2 == 0 or k % 5 == 0:
    print(-1)
    exit()

ai = 0
i = 0
while True:
    ai = (ai*10+7) % k
    i += 1
    if ai == 0:
        print(i)
        break
A,B = map(int(input().split()))
if A>0 and A<10 and B>0 and B<10:
	print(A*B)
else:
	print(-1)

### FIXED CODE ###

A,B = map(int,input().split())
if A>0 and A<10 and B>0 and B<10:
	print(A*B)
else:
	print(-1)
import sys
def p(s):
  sys.stderr.write(str(s)+"\n")

N,Y=map(int, input().split())

p(N)
p(Y)

Amax=min(N,Y//10000)
Bmax=min(N,Y//5000)
Cmax=min(N,Y//1000)

p(Amax)
p(Bmax)
p(Cmax)

for a in range(Amax,-1,-1):
  B=min(Bmax,N-a)
  p("B="+str(B))
  for b in range(B,-1,-1):
    C=min(Cmax,N-a-b)
    p("a="+str(a)+", B="+str(B)+", C="+str(C))
    for c in range(C,-1,-1):
      n = a+b+c
      y = (a*10000)+(b*5000)+(c*1000)
      if n==N and y==Y:
        print(a,b,c,sep=" ")
        exit(1)

i=-1
print(i,i,i, sep=" ")


### FIXED CODE ###

import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")

N,Y=map(int, input().split())
p(N,Y)

NAmax=min(N,Y//10000)
NBmax=min(N,Y//5000)
NCmax=min(N,Y//1000)
p(NAmax, NBmax, NCmax)

NA=NAmax
for a in range(NA,-1,-1):
  NB=min(NBmax,N-a)

  for b in range(NB,-1,-1):
    c = N-a-b
    y = (a*10000)+(b*5000)+(c*1000)
    if y==Y:
      print(a,b,c,sep=" ")
      exit()
      
i=-1
print(i,i,i, sep=" ")
text = input()
i = 0
ans = "keyence"
for ob_n in range(len(lists)):
    if text[i] != ans[ob_n]:
        if text.endswith(ans[ob_n:]):
            flag = 1
            break
        else:
            flag = 0
            break
    i+=1
    if i == len(text):
        flag = 1
        break
if flag == 1:
    print("YES")
else :
    print("NO")
        

### FIXED CODE ###

text = input()
i = 0
ans = "keyence"
for ob_n in range(len(ans)):
    if text[i] != ans[ob_n]:
        if text.endswith(ans[ob_n:]):
            flag = 1
            break
        else:
            flag = 0
            break
    i+=1
    if i == len(text):
        flag = 1
        break
if flag == 1:
    print("YES")
else :
    print("NO")
A,B,M = map(int,input().split())
A_ = list(map(int,input().split()))
B_ = list(map(int,input().split()))
mini =min(A_) + min(B_)
for i in range(M):
    array = list(map(int,input().split()))
    m = A_[array[0]-1] + B_[array[0]-1] -array[2]
    if(mini > m):
        mini = m
print(mini)


### FIXED CODE ###

A,B,M = map(int,input().split())
A_ = list(map(int,input().split()))
B_ = list(map(int,input().split()))
mini =min(A_) + min(B_)
for i in range(M):
    array = list(map(int,input().split()))
    m = A_[array[0]-1] + B_[array[1]-1] -array[2]
    if(mini > m):
        mini = m
print(mini)
X, Y = map(int, input().split())

ans = 'No'
if a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
        print('Yes')


### FIXED CODE ###

X, Y = map(int, input().split())
 
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)
n=int(input())
a=input()
b=input()
for i in range(n):
    print(a[i],end="")
    print(b[i],end="")
print()
    

### FIXED CODE ###

n=int(input())
a,b=map(str,input().split())
for i in range(n):
    print(a[i],end="")
    print(b[i],end="")
print()
# -*- coding: utf-8 -*-


def bubble_sort(a, N):
    change = 0
    for i in xrange(N - 1):
        for j in xrange(N - 1, i, -1):
            if a[j - 1] < a[j]:
                temp = a[j - 1]
                a[j - 1] = a[j]
                a[j] = temp
                change += 1
    return (a, change)


if __name__ == "__main__":
    N = input()
    a = map(int, raw_input().split())
    # a = [5, 2, 4, 6, 1, 3]
    result, change = bubble_sort(a, N)
    print print ','.join(map(str, result))
    print change

### FIXED CODE ###

#! /usr/bin/env python
#-*- coding: utf-8 -*-

''' ?????????????????? '''

# O(n^2)


def bubble_sort(A, N):
    swap_num = 0  # ?????????????????°

    for i in range(N - 1):
        for j in range(N - 1, i, -1):
            if A[j] < A[j - 1]:
                # swap
                temp = A[j]
                A[j] = A[j - 1]
                A[j - 1] = temp
                swap_num += 1

    return (A, swap_num)


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    # A = [5, 2, 4, 6, 1, 3]
    # N = len(A)
    array_sorted, swap_num = bubble_sort(A, N)
    print(' '.join(map(str, array_sorted)))
    print(swap_num)
B=input()
print("T" if B=="A" else "A" if B=="T" else "G" if B=="C" else "C" if B=="G")


### FIXED CODE ###

B=input()
print("T" if B=="A" else "A" if B=="T" else "G" if B=="C" else "C")
import sys
lc=lambda n:int((n**2+n+2)/2)
[print(i) for i in [lc(int(j)) for j in sts.stdin]]


### FIXED CODE ###

import sys
lc=lambda n:int((n**2+n+2)/2)
[print(i) for i in [lc(int(j)) for j in sys.stdin]]
a, b, c= map(int, .input().split())
kawaiso = 0 
if a==b and a!=c:
    kawaiso = 1
 
 else if  b==c and b!=a :
    kawaiso = 1
 
 else if c==a and c!=b :
    kawaiso = 1

if kawaiso == 1 :
    print ('Yes')
    
    else :
      print('No')

### FIXED CODE ###

a, b, c= map(int, input().split())
kawaiso = 0 
if a==b and a!=c:
    kawaiso = 1
 
elif  b==c and b!=a:
    kawaiso = 1
 
elif c==a and c!=b:
    kawaiso = 1
    
else:
    kawaiso = 0
  
 
if kawaiso == 1:
    print ("Yes")
    
else:
    print("No")
N, A, B = map(int, input().split())

counter = [0 for _ in range(N)]
ans = 0

for i in range(1,N+1):
    #st = str(i)
    for j in str(i):
        counter[i] += int(j)
    if A<= counter[i] <=B :
        ans += i

print(ans)

### FIXED CODE ###

N, A, B = map(int, input().split())
ans = 0

for i in range(1, N+1):
    num_sum = 0
    for j in str(i):
        num_sum += int(j)
    if A<= num_sum <= B:
        ans += i

print(ans)
N = int(input())
a = list(map(int, input().split()))

even4, ,even, odd = 0, 0, 0
for i in a:
    if i % 4 == 0:
        even4 += 1
    elif i % 2 == 0:
        even += 1
    else:
        odd += 1

if n % 2 == 0:
    if even4 >= odd:
        print("Yes")
    else:
        print("No")
else:
    if even4 >= odd + 1:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))

even4, even, odd = 0, 0, 0
for i in a:
    if i % 4 == 0:
        even4 += 1
    elif i % 2 == 0:
        even += 1
    else:
        odd += 1

if N % 2 == 0:
    if even4 >= odd:
        print("Yes")
    else:
        print("No")
else:
    if even4 >= odd - 1:
        print("Yes")
    else:
        print("No")
K, N = map(int, input().split())
A = [int(e) for e in input().split()]

ans = 0
for i in range(N - 1):
    S = [A[i] - A[i + 1]]
    S.append(A[N] - A[0])
    S.sort
    for n in range(N - 1):
        ans += S[i]
print(ans)

### FIXED CODE ###

K, N = map(int, input().split())
A = [int(e) for e in input().split()]

ans = 0
S = [(A[i + 1] - A[i]) for i in range(N - 1)]
S.append((K - A[N - 1]) + A[0])
S.sort
m = sorted(S)
for n in range(N - 1):
    ans += m[n]
print(ans)
n = int(input())
arr = input().split()
ans = []
for i in range(n):
    arr[i] = int(arr[i])
x = 0
y = sum(arr)
for i in range(n):
    if x <= y:
        x += arr[i]
        y -= arr[i]
        ans.append(abs(x - y))
print(min(ans))


### FIXED CODE ###

n = int(input())
arr = list(map(int,input().split()))
sum_arr = sum(arr)
ans=[]
x = 0
for i in range(n-1):
    x += arr[i]
    y = sum_arr - x
    ans.append(abs(x - y))
print(min(ans))
from heapq import heappush, heappop
import sys

N,K = list(map(int, input().split(' ')))
d = {}
for i in range(N):
    S = str(input())[0]
    if S in d:
        d[S] += 1
    else:
        d[S] = 1
p = list(d.values())
if len(p) < K:
    print(0)
    sys.exit(1)

h = []
for i in p:
    heappush(h, i)

while(len(h) > K):
    k = heappop(h) + heappop(h)
    heappush(h, k)

print(min(h))

### FIXED CODE ###

import sys
N,K = list(map(int, input().split(' ')))
d = {}
for i in range(N):
    S = str(input())[0]
    if S in d:
        d[S] += 1
    else:
        d[S] = 1
p = list(d.values())
if len(p) < K:
    print(0)
    sys.exit()
c = 0
while(len(p) >= K):
    c += 1
    sq = sorted(p, reverse=True)
    for i in range(K):
        sq[i] = sq[i] - 1
    p = [i for i in sq if i != 0]
print(c)
_,*p=map(int,open(0).read().split())
i=0
p.sort()
while(len(p)!=0):
  t=p[0]
  p=[m if m!=t else 0 for m in p[1:] if m%t!=0 or m==t ]
  if 0 in p:
    p=[i for i in p if i!=0]
  else:i+=1
print(len(q))

### FIXED CODE ###

M=10**6+1
_,*l=map(int,open(0).read().split())
a=[0]*M
for i in sorted(l):
  a[i]+=1
  if a[i]==1:
    for j in range(2*i,M,i): a[j]+=2
print(a.count(1))
numInput = int(input())

amount = numInput
numOdd = int(numInput / 2) + (numInput % 2)
numEven 0 int(numInput / 2)

while True:

    if amount >= 2:
        if numOdd >= 2:
            numOdd -= 2
            numEven += 1
            amount -= 1
        else:
            numEven -= 1
            amount -= 1
    else:
        break

if amount == 1:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

numInput = int(input())

numSequence = list(map(int, input().split(' ')))

numOdd = 0
for i in range(0, len(numSequence)):
    if numSequence[i] % 2 == 1:
        numOdd += 1
        
if numOdd % 2 == 0:
    print('YES')
else:
    print('NO')
ABC, ARCw = map(int, input().split())

if (s=ABC):
    print('ARC')
else:
    print('ABC')

### FIXED CODE ###

S = input()
if(S=='ABC'):
    print('ARC')
else:
    print('ABC')
W, H, x, y = map(int, input().split())
a = x*H
b = y*W
if x != 0 and x != W and y != 0 and y != H:
  if a < b:
    print(str(a) + " " + str(0))
  elif b < a:
    print(str(b) + " " + str(0))
  else:
    print(str(a) + " " + str(1))
else:
  print(str((H*W)/2) + " " + 0)

### FIXED CODE ###

W, H, x, y = map(int, input().split())
if x == W/2 and y == H/2:
  print(str((H*W)/2) + " " + "1")
else:
  print(str((H*W)/2) + " " + "0")
N= int(input())
A = list(map(int,input().split()))
for i in range(N):
  A = A[i]+i+1
A.sort()
b =A[N//2]
ans =0
for a in A:
  ans += abs(a -b)
  
  
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = A[i] - i + 1
A.sort()
b = A[N // 2]
ans = 0
for a in A:
    ans += abs(a - b)

print(ans)
from collections import defaultdict

N = int(input())
dict = defaultdict(int)
ans = 0
for i in range(N):
    s = ''.join(sorted(input()))
    ans += dict[s]
    dict[s] += 1
print(ans)


### FIXED CODE ###

import collections
n = int(input())
l = list(map(int,input().split()))
k = []
for i in range(n):
    k.append(i+1+l[i])
c = collections.Counter(k)
cnt = 0
for i in range(n):
    cnt += c[i+1-l[i]]
print(cnt)
n=int(input())
d=list(map(int,input().split())
hp=0
for i in range(n):
       for j in range(i+1,n):
            hp=hp+d[i]*d[j]
print(hp)


### FIXED CODE ###

n=int(input())
d=list(map(int,input().split()))
hp=0
for i in range(n-1):
       for j in range(i+1,n):
            hp=hp+d[i]*d[j]
print(hp)
n, m = [int(i) for i in input().split(" ")]
score_dict = {}
 
for i in range(m):
    p, s = input().split(" ")
    if p not in score_dict:
        score_dict[p] = []
    
    score_dict[p].append(s)
 
ac_count = 0
wa_count = 0
 
for i in score_dict.values():
    if "AC" in i:
        ac_count += 1
    
    wa_count += len(i[:i.index("AC")])
 
print("{0} {1}".format(ac_count, wa_count))

### FIXED CODE ###

n, m = [int(i) for i in input().split(" ")]
score_dict = {}
 
for i in range(m):
    p, s = input().split(" ")
    if p not in score_dict:
        score_dict[p] = []
    
    score_dict[p].append(s)
 
ac_count = 0
wa_count = 0
 
for i in score_dict.values():

    if "AC" in i:
        ac_count += 1
        wa_count += i.index("AC")
 
print("{0} {1}".format(ac_count, wa_count))
import numpy as np
import math
import sys
sys.float_info.max
H, W, A, B = map(int, input().split())

StoB = np.zeros(B)
BtoE = np.zeros(B)
sum = 0
# print(StoB)
# print(BtoE)
all = math.factorial(H + W - 2) / (math.factorial(H - 1) * math.factorial(W - 1))
# print(all)
for i in range(B):
    # print(i)
    # print(H - A)
    StoB[i] = math.factorial((i) + (H - A - 1)) / (math.factorial(i) * math.factorial(H - A - 1))
    # print(StoB[i])
# print(StoB)
    BtoE[i] = math.factorial((W - i) + A - 2) / (math.factorial(W - i - 1) * math.factorial(A - 1))
# print(BtoE)
    sum += StoB[i] * BtoE[i]
print(int(all - sum))


### FIXED CODE ###

h,w,a,b = map(int,input().split()) #入力
mod = 10**9+7 

#前計算　f[i] = i!
f=[1]
for i in range(h+w):
  f.append(f[i]*(i+1)%mod)

#C(n,r,p) = ( n! * r!^(p-2) * (n-r)!^(p-2) )%p
#pythonだとpow()で二分累乗法が使える
def comb(n, r, p):
  return f[n] * pow(f[r], p-2, p) * pow(f[n-r], p-2, p) % p

#紫点ごとに調べる
ans=0
for i in range(b, w):
  ans+= comb(h+i-a-1, i, mod) * comb(w-1-i+a-1, a-1, mod) % mod

print(ans%mod)
# -*- coding: utf-8 -*-

def solve():
    w = int(input())
    n = int(input())
    l = [i for i in range(1, w+1)]

    for _ in range(n):
        a, b = map(int, input().split(','))
        l[a], l[b] = l[b], l[a]

    print(*l, sep='\n')

solve()

### FIXED CODE ###

# -*- coding: utf-8 -*-


def solve():
    w = int(input())
    n = int(input())
    l = [i for i in range(1, w+1)]

    for _ in range(n):
        a, b = map(int, input().split(','))
        a -= 1
        b -= 1
        l[a], l[b] = l[b], l[a]

    print(*l, sep='\n')

solve()
m,d = map(int,input())
count = 0
for i in range(m) :
  for j in range(d) :
    if j <11 :
      continue
    str_j = str(j)
    temp = int(str_j[0]) * int(str_j[1])
    if temp == i :
      count+=1
print(count)

### FIXED CODE ###

m,d = map(int,input().split(" "))
count = 0
for i in range(1, m+1) :
  for j in range(1, d+1) :
    if j < 10 :
      continue
    str_j = str(j)
    d1, d2 = int(str_j[0]), int(str_j[1])
    if d1 < 2 or d2 < 2 :
    	continue
    temp = d1 * d2
    if temp == i :
      count+=1
print(count)
s = input()
s=list()
zeroc=0
onec=0
for i in s:
  if i == 0:
    zeroc++
  if i == 1:
    onec++
print(min(zeroc,onec)*2)

### FIXED CODE ###

s = input()
s=list(s)
zeroc=0
onec=0
for i in s:
  if i == "0":
    zeroc+=1
  if i == "1":
    onec+=1
print(min(zeroc,onec)*2)
import math
import queue

N = int(input())
As = sorted(list(map(int, input().split())))

ques = [queue.Queue() for i in range(N)]

for i, Ai in enumerate(As):
    qi = ques[i]
    for j in range(2,int(math.sqrt(Ai))+1) :
        if (Ai % j == 0) :
            qi.put(j)
    
flag = True
while flag:
    for i, qi in enumerate(ques):
        if(qi.empty()) :
            As[i] = As[-1]
            flag = False
            break
        else :
            qi.get()

min_num = As[0]
gcd_num = math.gcd(As[0], As[1])
for i in range(2,N) :
    #改善の余地あり
    gcd_num = math.gcd(gcd_num, As[i])
    if (gcd_num==1) :
        break

print(gcd_num)

### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools, bisect
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def SL(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]

def perm(n, r): return math.factorial(n) // math.factorial(r)
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))

alphabets = "abcdefghijklmnopqrstuvwxyz"
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007
INF = float("inf")

def main():
    N = I()
    A = LI()

    forward = list(itertools.accumulate(A, math.gcd))
    backward = list(itertools.accumulate(A[::-1], math.gcd))[::-1]

    ans = max(backward[1], forward[-2])

    for i in range(1, N - 1):
        ans = max(ans, math.gcd(forward[i - 1], backward[i + 1]))
    print(ans)


if __name__ == '__main__':
    main()
a,b = map(list, input().split())
print(a*b, 2*(a+b))


### FIXED CODE ###

string = input()
a,b = map(int,string.split(' '))
print(a*b, 2*(a+b))
n=int(input())
a=[input() for i in range(n)]
s=0
for i in range(n-1):
    if a[i][-1]!=a[i+1][0]:
        s+=1
a.sort()
for i in range(n-1):
    if a[i]==a[i+1]:
        s+=1
if s==0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b=map(int,input().split())
if a*b%2==0:
	print("No")
else:
    print("Yes")
N,K=map(int,input().split())
A=list(map(int,input().split()))
a=0
cnt=0
anlist=[0]*K
while True:
  if A[A[a]-1]==1:
    break
  else:
    anlist[cnt]=A[A[a]-1]
    a=A[a]-1
    cnt+=1
res=N%cnt
ans=anlist[res]
print(ans)  

### FIXED CODE ###

N,K,*A=map(int, open(0).read().split())
x=1
C=[None]*N
C[0]=0
c=0
while c<K:
    x=A[x-1]
    c+=1
    if C[x-1] is None:
        C[x-1]=c
    else:
        a=C[x-1]
        b=c-a
        K=(K-a)%b+a+b
        while c<K:
            x=A[x-1]
            c+=1
        break
print(x)
n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=list(input())

# d={'r':0,'s':0,'p':0}
d={}
ans=0
c=0
for i in t:

    if c >= k:
        x =d[c-k]
        if i =='r':
            if x == 'p':
                if t[c+k] == 's':
                    d[c]='s'
                else:
                    d[c]='r'
            else:
                ans += p ; d[c]='p'
        elif i == 's': 
            if x == 'r':
               if t[c+k] == 'p':
                    d[c]='p'
               else:
                    d[c]='s'
            else:
                ans += r;d[c]='r'
        elif i == 'p': 
            if x == 's':
               if t[c+k] == 'r':
                    d[c]='r'
               else:
                    d[c]='p'
            else:
                ans += s;d[c]='s'

    else:
        if i =='r':
            ans += p ; d[c]='p'
        elif i == 's': 
            ans += r;d[c]='r'
        elif i == 'p': 
            ans += s;d[c]='s'

    c+=1


print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=list(input())

# d={'r':0,'s':0,'p':0}
d={}
ans=0
c=0
for i in t:

    if c >= k:
        x =d[c-k]
        y = c+k
        if i =='r':
            if x == 'p':
                if  y < n and t[y] == 's':
                    d[c]='s'
                else:
                    d[c]='r'
            else:
                ans += p ; d[c]='p'
        elif i == 's': 
            if x == 'r':
               if y < n and t[y] == 'p' :
                    d[c]='p'
               else:
                    d[c]='s'
            else:
                ans += r;d[c]='r'
        elif i == 'p': 
            if x == 's':
               if  y < n and t[y] == 'r':
                    d[c]='r'
               else:
                    d[c]='p'
            else:
                ans += s;d[c]='s'

    else:
        if i =='r':
            ans += p ; d[c]='p'
        elif i == 's': 
            ans += r;d[c]='r'
        elif i == 'p': 
            ans += s;d[c]='s'

    c+=1


print(ans)
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = []
C = []
for i in range(Q):
    b, c = list(map(int, input().split()))
    B.append(b)
    C.append(c)

total = sum(A)

for i in range(Q):
    count = A.count(B[i])

    d = C[i] - B[i]
    total += count * B
    print(total)

    A = [C[i] if x == B[i] else x for x in A]


### FIXED CODE ###


N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = []
C = []
for i in range(Q):
    b, c = list(map(int, input().split()))
    B.append(b)
    C.append(c)

max_num = max(max(A), max(B), max(C))

NUM = [0] * (max_num + 1)

num_list = []

for a in A:
    NUM[a] += 1

total = sum(A)

for i in range(Q):

    total += (C[i] - B[i]) * NUM[B[i]]
    NUM[B[i]], NUM[C[i]] = 0, NUM[B[i]] + NUM[C[i]]

    print(total)
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 14:44:47 2018
ABC046C
@author: maezawa
"""
import math
n = int(input())
ti, ai = list(map(int, input().split()))
vp = ti + ai
tp = ti
ap = ai
for i in range(1,n):
    t, a = list(map(int, input().split()))
    if ti == t and ai == a:
        continue
    ti = t
    ai = a
    niv = vp/(ti+ai)
    nit = tp/ti
    nia = ap/ai
    ni = math.ceil(max(nit, nia))
    vi = ni*(ti+ai)
    vp = vi
    #print(ni, vi)
    tp = ni*ti
    ap = ni*ai

print(vi)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 14:44:47 2018
ABC046C
@author: maezawa
"""
import math
n = int(input())
tp = 1
ap = 1
for i in range(n):
    ti, ai = list(map(int, input().split()))
    #nit = math.ceil(tp/ti)
    #nia = math.ceil(ap/ai)
    nit = -tp//ti
    nia = -ap//ai
    ni = max(-nit, -nia)
    vi = ni*(ti+ai)
    #print(ni, vi)
    tp = ni*ti
    ap = ni*ai

print(vi)
coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())
all_ans = comb(n, k, exact=True)
cmb = 0
#print(a)

for i, j in zip(range(n-k+1, n), range(1, k)):
    #print(i, j)
    a = comb(i, j, exact=True)
    ans = a % (pow(10,9)+ 7)
    cmb += ans
    print(ans)

print((all_ans - cmb) % (pow(10,9)+ 7))


### FIXED CODE ###

#coding:utf-8
from scipy.misc import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)
while True:
    n, w = map(int, raw_input().split())
    if n == 0:
        break
    lst = []
    for i in range(n):
        num = input()
        num /= w
        lst.append(num)

    ans = 0.0
    cnt = [0 for i in range(100)]
    for i in range(n):
        num = max_num - lst[i]
        ans += num
        cnt[num] += 1
    
    print ans / max(lst) / max(cnt) + 0.01


### FIXED CODE ###

#!/usr/bin/env python

import sys
import math
import itertools as it
from collections import deque

sys.setrecursionlimit(10000000)

while True:
    n, w = map(int, raw_input().split())
    if n == 0:
        break
    lst = []
    for i in range(n):
        num = input()
        num /= w
        lst.append(num)
    max_num = max(lst)

    ans = 0.0
    cnt = [0 for i in range(100)]
    for i in range(n):
        num = max_num - lst[i]
        ans += num
        cnt[num] += 1
    
    max_cnt = max(cnt)
    print ans / max_num / max_cnt + 0.01
    pass
a,b,c = map(int,raw_input().split())
if (a==b and b!=c) or (a==c and c!=b) or (c==b and c!=a):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c = map(int,input().split())
if (a==b and b!=c) or (a==c and c!=b) or (c==b and c!=a):
  print("Yes")
else:
  print("No")