Harryxun/stf_run huggingface dataset:
r=0
s=input()
for n in len(s):
  if s[n] != s[(-1)*(n+1)]:
    r+=1
print(r/2)

### FIXED CODE ###

r = 0
s = input()
for n in range(len(s)):
  if s[n] != s[-n-1]:
    r += 1
print(r//2)
d,t,s = map(int,input().split())
if d/s <=t　:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

d,t,s = map(int,input().split())
if d/s <=t:
  print('Yes')
else:
  print('No')
class AC:
    @staticmethod
    def inputStr(char):
        return input().split(char)
    
    @staticmethod
    def inputInt(char):
        a = input().split(char)
        for i in range(len(a)):
            a[i] = int(a[i])
        return a

inp = AC.inputStr(" ")
A = inp[0]
B = inp[1]
K = inp[2]

for i in range(K):
    if A > 0 :
        A = A-1
    elif B > 0 :
        B = B-1
print(str(A) + " " + str(B))

### FIXED CODE ###

A,B,K = map(int,input().split(" "))
if A+B < K:print(0,0)
elif A > K:print(A-K,B)
elif A  <= K:print(0,A+B-K)
# Kenparさん、写経させていただきました。ありがとうございます。
# こんな解法があったなんて・・・
import math
I = input().split()
A = int(I[0])
B = int(I[1])
N = int(I[2])
def fl(x):
    return math.floor((A*x)/B) - A*math.floor(x/B)

An =fl(N)

if A == 1 and B == 1 :
    An = 0

if B < N :
    for i in range(B,N) :
        if i >= B+1 and fl(i) <= fl(i-1) :
            An = fl(i-1)
            break
elif B == N :
    An = fl(N-1)

print(str(An))

### FIXED CODE ###

I = [input() for i in range(2)]
K = int(I[0])
S = I[1].split()
A = int(S[0])
B = int(S[1])

na = A//K
nb = B//K

la = A%K
lb = B%K

#print(na)
#print(nb)

if na < nb or la == 0 or lb == 0 :
    ans = 'OK'
else:
    ans = 'NG'

print(ans)
list = []
list.append(input())



for i in range(1,5):
  if list[i-1] != i:
    return(i)

### FIXED CODE ###

list1 = list(map(int, input().split()))


for i in range(1,6):
  if list1[i-1] != i:
    print(i)
n=int(input())

def read_n_lows_input(n):
    Alist=[int(input()) for i in range(n)]
    return Alist

A = read_multi_low_input_with_num(n)

def max_profit(A, n):
    for i in range(0, n):
        for j in range(i+1, n):
            if i == 0 and j == 1:
                maxA = A[j] - A[i]
            if A[j]-A[i] > maxA:
                maxA = A[j]-A[i]
    print(maxA)

max_profit(A, n)


### FIXED CODE ###

def max_profit(A, n):
    minv = A[0]
    for j in range(1, n):
        if j == 1:
            maxv = A[j] - A[j-1]
        if maxv < A[j] - minv:
            maxv = A[j] - minv
        if minv > A[j]:
            minv = A[j]
    print(maxv)

n=int(input())
A=[int(input()) for i in range(n)]

max_profit(A, n)
n = int(input())
a = [int(i) for i in input().spliit()]
ans = 0

while True:
  if [i for i in a if a%2 == 1]:
    break
  a = [ i//2 for i in a]
  ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
ans = 0

while True:
  if [i for i in a if i%2 == 1]:
    break
  a = [ i//2 for i in a]
  ans += 1
print(ans)
# -*- coding: utf-8 -*-
def Palindrome(S):
    for i in range(int(len(S)/2)):
        if S[i]==S[len(S)-i-1]:
            YorN="Yes"
        else:
            YorN="No"
            break
    return YorN
S = input()
Sl = list(S)
left = right = "No"
if Palindrome(Sl) == "Yes":
    middle=int(len(Sl)/2)
    left  = Palindrome(Sl[:middle])
    right = Palindrome(Sl[middle+1:])
if left == "Yes" and right == "Yes":
    YorN = "Yes"
else:
    YorN = "No"
print(YorN)

### FIXED CODE ###

# -*- coding: utf-8 -*-
def Palindrome(S):
    if len(S)==1:
        return "Yes"
    for i in range(int((len(S))/2)):
        if S[i]==S[len(S)-i-1]:
            YorN="Yes"
        else:
            YorN="No"
            break
    return YorN
S = input()
Sl = list(S)
left = right = "No"
if Palindrome(Sl) == "Yes":
    middle=int((len(Sl)-1)/2)
#    print(Sl[:middle],Sl[middle+1:])
    left  = Palindrome(Sl[:middle])
    right = Palindrome(Sl[middle+1:])
if left == "Yes" and right == "Yes":
    YorN = "Yes"
else:
    YorN = "No"
print(YorN)
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
R = []
for i range(N):
  R.append(V[i] - C[i])
cost = 0
for r in R:
  if r > 0:
    cost += r
print(cost)
  

### FIXED CODE ###

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
R = []
for i in range(N):
  l = V[i] - C[i]
  R.append(l)
cost = 0
for r in R:
  if r > 0:
    cost += r
print(cost)
import sys
from heapq import heappush as hpu
from heapq import heappop as hpo
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

base = 10 ** 10
sb = [(-b[i], i) for i in range(N) if a[i] != b[i]]
h = []
hpu = lambda x: hpu(h, x)
for t in sb: hpu(t)
res = 0
while len(h):
  v, i = hpo(h)
  v = -v
  if v < a[i]:
    print(-1)
    exit(0)
  d = v - a[i]
  x = b[i - 1] + b[(i + 1) % N]
  t = d // x
  if t == 0:
    if v == a[i]: continue
    print(-1)
    exit(0)
  b[i] -= x * (t)
  res += t
  hpu((-b[i], i))
print(res)


### FIXED CODE ###

import sys
from heapq import heappush as hpu
from heapq import heappop as hpo
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

base = 10 ** 6
sb = [-(b[i] * base + i) for i in range(N) if a[i] != b[i]]
h = []
for t in sb: hpu(h, t)
res = 0
while len(h):
  v = hpo(h)
  i = -v % base
  v = -v // base
  if v < a[i]:
    print(-1)
    exit(0)
  d = v - a[i]
  x = b[i - 1] + b[(i + 1) % N]
  t = d // x
  if t == 0:
    if v == a[i]: continue
    print(-1)
    exit(0)
  b[i] -= x * (t)
  res += t
  hpu(h, -(b[i] * base + i))
print(res)
is=list(map(int,input().split()))
print(sorted(lis)[0]+sorted(lis)[1])

### FIXED CODE ###

lis=list(map(int,input().split()))
print(sorted(lis)[0]+sorted(lis)[1])
a, b= [input() for _ in range(2)]
c=int(a+b)
import math
for i in range(317):
    if i**2==c:
        print("Yes")
        break
else:
    print("No")

### FIXED CODE ###

from math import sqrt
a, b = input().split()
n = int(a+b)
if(int(sqrt(n))**2 == n):
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline
from collections import deque
N = int(input())
graph = [deque([]) for _ in range(N)]
has = []
stack = []
for i in range(N):
  u,k,* v = [int(x) for x in input().split()]
  v.sort()
  for j in v:
    graph[u-1].append(j)
time = 0
arrive_time = [-1]*N

def dfs(x):
  stack.append(x)#探索スタート地点を「探索候補スタック」に積む
  while stack:#stackが空になるまで
    v = stack.pop()
    has.append(v)#探索済みリストに取り出した地点を格納（ここが現在地点）    
    for i in graph[v-1]:
      if i in has:
        continue
      elif i in stack:
        continue
      else:
        stack.append(i)
  print(*has)
dfs(1)


### FIXED CODE ###

N,R = map(int,input().split())
if N >= 10:
  print(R)
else:
  print(R+100*(10-N))
N = input()
S = len(N)
sen = int(N) / 1000
hyaku =( int(N) - sen*1000 ) / 100
zyuu = (int(N) - sen*1000- hyaku*100) / 10
iti = int(N) - sen*1000- hyaku*100- zyuu*10

f = sen + hyaku + zyuu + iti

if int(N)%f==0:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

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

NA = N * A
if NA > B:
    print(B)
else:
    print(NA)
n,m = map(int,input().split())
num = list(map(int,input().split()))
limit = 1/(4*m)
count = 0
for i in range(n):
  if num[i] >= limit: count += 1
if count >= m: print(‘Yes’)
else: print(‘No’)


### FIXED CODE ###

N,M = map(int, input().split())
A = input().split()
A = [int(i) for i in A]

limit = sum(A) / (4*M)
flag = 0

for i in A:
  if i>=limit: flag += 1
    
if flag>=M: print('Yes')
else: print('No')
N = int(input())
A = [int(x) for x in input().split()]

def GCD(m, n):
  a = max(m, n)
  b = min(m, n)
  while b > 0:
    r = a % b
    if r == 0:
      return b
    a = b
    b = r  

import numpy as np

B = np.ones((N, N)) * 10 ** 10

for m in range(N):
  for n in range(m, N):
    if m == n:
      B[m, m] = 0
    else:
      B[m, n] = B[n, m] = GCD(A[m], A[n])

C = B.sum(axis=1)
idx = C.argmin()

B = np.where(B == 0, 10 ** 10, B)
B = np.delete(B, idx, axis=0)
B = np.delete(B, idx, axis=1)
print(int(B.min()))

### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]

def GCD(m, n):
  if m == 0:
    return n
  elif n == 0:
    return m
  a = max(m, n)
  b = min(m, n)
  while b > 0:
    r = a % b
    if r == 0:
      return b
    a = b
    b = r  

L = [0] * (N + 1)
R = [0] * (N + 1)
for i in range(N):
  L[i + 1] = GCD(L[i], A[i])
  R[N - i - 1] = GCD(R[N - i], A[N - i - 1])
M = [GCD(L[i], R[i+1]) for i in range(N)]
print(max(M))
#最も上にいる親をたどる
# xは自分自身の番号を示す。
# r[x]は自分の親を示す。親がいない場合は-1を示す。
def root(x):
  # case parent
  if r[x] < 0:
    return x
  # case child
  else:
    return root(r[x])

#from operator import itemgetter

n, m = map(int, input().split())
road = [list(map(int,input().split())) for i in range(m)]
#root -1は上がいない、そのほかは親をもちその数字を表す。
r = [-1]*(n+1)

#print(g)

road = sorted(road, key=lambda x:(x[0], x[1]))
#print(r)

group_num = 1;

for i, city in enumerate(road):
  city_a = city[0]
  city_b = city[1]
  city_a_par = root(city_a)
  city_b_par = root(city_b)
  
  #print(r)
  #print("city_a", city_a, "city_b", city_b)
  
  # 親に子をつなげていく
  # cityに親がいない（自分が親である=-1可能性あるが問題ない）
  if r[city_a] == -1 and r[city_b] == -1:
    # city_bの親をcity_aにする
    r[city_b] = city_a
  # どちらか片方のみが子である
  elif r[city_a] == -1 or r[city_b] == -1:
    # aが子
    if r[city_a] > r[city_b]:
      r[city_b] = r[city_a]
    # bが子
    else:
      r[city_a] = r[city_b]
  # aもbも誰かの子である
  else:
    if city_a_par == city_b_par:
      pass
    else:
      r[city_a_par] = city_b
      
del r[0]
#print(group_num-1)
#print(r.count(-1))
#print(r)
print(group_num-1+r.count(-1)-1)

### FIXED CODE ###

class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
    # ノードxのrootノードを見つける
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def unite(self, x, y):
    # 木の併合、入力は併合したい各ノード⇒(a,b)
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
    # ノードxが属する木のサイズを返す
        return -self.parents[self.find(x)]

    def same(self, x, y):
    # 入力ノード(x,y)が同じグループに属するかを返す
        return self.find(x) == self.find(y)

    def members(self, x):
    #ノードxが属するメンバーをリスト形式で返す
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
    #親全てをリスト形式で返す
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
    #グループ数の合計を返す
        return len(self.roots())

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

n,m=map(int,input().split())
u=UnionFind(n)
for i in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    u.unite(a,b)
ans=u.roots()
print(len(ans)-1)
S = list(input())
for i in range(S):
  if i % 2 == 0:
    print(S[i], end='')

### FIXED CODE ###

S = list(input())
for i, s in enumerate(S):
  if i % 2 == 0:
    print(s, end='')
n, k = map(int, input().split())
t = n%k
print(min(t,abs(k-t)))

### FIXED CODE ###

a, b, c = map(int, input().split())
hoge = a 
a = b
b = hoge
hoge = a
a = c
c = hoge

print(a,b,c)
import sys
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline()
def read(): return int(input())
def reads(): return [int(i) for i in input().split()]

N, Y = reads()

y_max = min(N, Y//10000)
i_max = min(N, Y//5000)
h_max = min(N, Y//1000)

ans = (-1, -1, -1)

for y in range(y_max+1):
	for i in range(i_max+1):
		for h in range(h_max+1):
			if 10000*y + 5000*i + 1000*h == Y:
				ans = (y, i, h)
				break

print(ans[0]+' '+ans[1]+' '+ans[2])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline()
def read(): return int(input())
def reads(): return [int(i) for i in input().split()]

N, Y = reads()

x_max = min(N, Y//10000)
y_max = min(N, Y//5000)

ans = (-1, -1, -1)

for x in range(x_max+1):
	for y in range(min(y_max+1, N-x+1)):
		if 10000*x + 5000*y + 1000*(N-x-y) == Y:
			ans = (x, y, N-x-y)
			break

print(str(ans[0])+' '+str(ans[1])+' '+str(ans[2]))
N,M=map(int,input())
if N=M:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N,M=map(int,input().split())
if N==M:
  print("Yes")
else:
  print("No")
N, M = map(int, input().split())
X = list(map(int, input().split()))

XS = sorted(X)
XD = []
for i in range(0, len(XS)-1):
    XD.append(XS[i + 1] - XS[i])

XD2 = sorted(XD)
print(sum(XD2[:M-N]))

### FIXED CODE ###

T, X = list(map(int, input().split()))

print(float(T)/float(X))
import numpy as np
import sys
sys.setrecursionlimit(10**9)

def main():
    N = int(input())
    A = np.array(list(map(int,input().split())))

    X = np.zeros((N,N))
    for i in range(N-1):
        for j in range(2):
            X[i][j+i] = 1

    X[N-1][0] = 1
    X[N-1][N-1] = 1

    ans = map(lambda y: int(y)*2, np.dot(np.linalg.inv(X),A))
    print(*ans)

if __name__ == "__main__":
  main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def main():
    N = int(input())
    A = list(map(int,input().split()))

    s = sum(A)
    x1 = s

    for k in range(N//2):
        x1 -= 2 * A[2*k+1]

    X = [x1]
    for i in range(N):
        x = 2 * A[i] - X[i]
        X.append(x)

    print(*X[:-1])


if __name__ == "__main__":
  main()
s = input()
count = 0
for i in range(4):
  if s[i] == +:
    count += 1
  else:
    count -=1
print(count)

### FIXED CODE ###

s = input()
count = 0
for i in range(4):
  if s[i] == "+":
    count += 1
  else:
    count -=1
print(count)
N=int(input())
if N==1:
    print('Hello World')
elif N==2:
    A,B=map(int,input().split())
    print('A+B')

### FIXED CODE ###

N=int(input())
if N==1:
    print('Hello World')
else:
    A=int(input())
    B=int(input())
    print(A+B)
#A
#入力
S,T=input().split()
A,B=input().split()
U=input()

#処理
if S==U:
    A-=1
elif T==U:
    B-=1
    
print(str(A)+" "+str(B))

### FIXED CODE ###

#A
#入力
S,T=input().split()
A,B=map(int,input().split())
U=input()

#処理
if S==U:
    A-=1
elif T==U:
    B-=1
    
print(str(A)+" "+str(B))
N,M=map(int,input().split())
l=list(map(int,input().split()))
w=[2,5,5,4,5,6,3,7,6]
dp=[0]*(N+1)
for j in l:
   dp[w[j-1]]=j
for i in range(N):
   if dp[i]!=0:
      for j in l:
         if w[j-1]+i<=N:
            dp[i+w[j-1]]=max(dp[i+w[j-1]],dp[i]*10+j)
print(dp[N])

### FIXED CODE ###

N,M=map(int,input().split())
l=list(map(int,input().split()))
w=[2,5,5,4,5,6,3,7,6]
l.sort()
dp=[0]*(max(N+1,8))
for j in l:
   dp[w[j-1]]=j
for i in range(N):
   if dp[i]!=0:
      for j in l:
         if w[j-1]+i<=N:
            dp[i+w[j-1]]=max(dp[i+w[j-1]],dp[i]*10+j)
print(dp[N])
a,b=map(int,input())
print((a+b+1)//2)

### FIXED CODE ###

a,b=map(int,input().split())
print((a+b+1)//2)
# -*- coding:utf-8 -*-
import sys

def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny] is sym:
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1, 0, 1, 0]
DY = [0, -1, 0, 1]
sys.setrecursionlimit(1000000)
tile = [[0 for i in range(1)] for j in range(1)]
while True:
	counter+=1
	line = input()
	if ' ' in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(N)] for j in range(M)]
	if N is 0 and M is 0:
		break
	else:
		tile[counter-2] = list(line)
	if (counter-1)==M:
		solve()
		counter = 0

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0
a,b,c = map(int,input().split())
print(max(0,c-(a-b))


### FIXED CODE ###

a,b,c = map(int,input().split())
print(max(0,c-(a-b)))
while 1:
        n = input()
        if n == 0: break
        ns=""
        for i in range(n):
                if i == 0: ns = str(input())
                temp = ''
                count = 1
                for j in range(len(ns)-1):
                        if ns[j] == ns[j+1]:
                                count += 1
                        else:
                                temp += str(count)+ns[j]
                                count = 1
                temp += str(count)+ns[-1]
                ns = temp
        print ns

### FIXED CODE ###

while 1:
        n = input()
        if n == 0: break
        ns=""
        for i in range(n):
                if i == 0: ns = raw_input()
                temp = ''
                count = 1
                for j in range(len(ns)-1):
                        if ns[j] == ns[j+1]:
                                count += 1
                        else:
                                temp += str(count)+ns[j]
                                count = 1
                temp += str(count)+ns[-1]
                ns = temp
        print ns
d={}
for s in sys.stdin:
  w,p=s.split()
  if not w in d: d[w]=[]
  d[w].append(int(p))
for w in sorted(d.keys()):
  print w,"\n"," ".join(map(str,sorted(d[w])))

### FIXED CODE ###

import sys

d={}
for s in sys.stdin:
  w,p=s.split()
  if w in d: d[w].append(int(p))
  else: d[w]=[int(p)]
  
for w,x in sorted(d.items()):
  print w
  print " ".join(map(str,sorted(x)))
r = input()

print("{}".format(2*3.1415*r))

### FIXED CODE ###

R = int(input())

print(R*3.1415*2)
def search(x, num):
    nodes.remove(x)
    search_list = []
    for y in list(edge[x]):
        if y in nodes:
            edge[y].discard(x)
            num = search(y, num)
    return num + 1


(n,m),*d  = [list(map(int, s.split())) for s in open(0)]

edge = [set() for _ in range(n+1)]
for x in d:
    edge[x[0]].add(x[1])
    edge[x[1]].add(x[0])

nodes = set(range(1,n+1))
ans = 1
for x in list(nodes):
    if x not in nodes:
        continue
    tmp = search(x, 0)
    ans = max(tmp, ans)
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(int(1e6))

def search(x, num):
    nodes.remove(x)
#     for y in edge[x]:
#         edge[y].discard(x)
#     for y in list(edge[x]):
    for y in edge[x]:
        if y in nodes:
            num = search(y, num)
    return num + 1

(n,m),*d  = [list(map(int, s.split())) for s in open(0)]

edge = [set() for _ in range(n+1)]
for x in d:
    edge[x[0]].add(x[1])
    edge[x[1]].add(x[0])

nodes = set(range(1,n+1))
ans = 1
for x in list(nodes):
    if x in nodes:
        ans = max(ans, search(x, 0))
print(ans)
while True:
	n = int(raw_input().strip())
	k = int(raw_input().strip())
	if n == k == 0:
		break
	nums = [raw_input().strip() for i in xrange(n)]
	print 0

### FIXED CODE ###

import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())
import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:map(int,input().split())

n=int(input())

a=list(mii())
a.sort()

if a[0]==a[n-1]:
    if 0 in b:
        print("Yes")
    else:
        print("No")
elif n%3:
    print("No")
else:
    a1,a2,a3=a[0],a[n//3],a[n//3*2]
    if a1!=a[n//3-1] or a2!=a[n//3*2-1] or a3!=a[n-1]:
        print("No")
    elif a1^a2!=a3 or a1^a3!=a2 or a2^a3!=a1:
        print("No")
    else:
        print("Yes")






### FIXED CODE ###


import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:map(int,input().split())

n=int(input())

a=list(mii())
a.sort()

if a[0]==a[n-1]:
    if a[0]==0:
        print("Yes")
    else:
        print("No")
elif n%3:
    print("No")
else:
    a1,a2,a3=a[0],a[n//3],a[n//3*2]
    if a1!=a[n//3-1] or a2!=a[n//3*2-1] or a3!=a[n-1]:
        print("No")
    elif a1^a2!=a3 or a1^a3!=a2 or a2^a3!=a1:
        print("No")
    else:
        print("Yes")
N, K = map(int, input().split()) # 横に2個
A = list(map(int, input().split()))

A.sort(reverse=True)

dif = []
for i in range(N-1):
    d = A[i] - A[i+1]
    if d != 0:
        dif.append(d)
mind = min(dif)

ans = 'IMPOSSIBLE'
for a in A:
    if a < K:
        break
    if a == K:
        ans = 'POSSIBLE'
        break
    if (a-K) % mind == 0:
        ans = 'POSSIBLE'
        break

print(ans)

### FIXED CODE ###

N, K = map(int, input().split()) # 横に2個
A = list(map(int, input().split()))

A.sort(reverse=True)

dif = []
for i in range(N-1):
    d = A[i] - A[i+1]
    if d != 0:
        dif.append(d)
if dif:
    mind = min(dif)
else:
    mind = A[0]

ans = 'IMPOSSIBLE'
for a in A:
    if a < K:
        break
    if a == K:
        ans = 'POSSIBLE'
        break
    if (a-K) % mind == 0:
        ans = 'POSSIBLE'
        break

print(ans)
n=int(input())
ans = 0
for i in range(1,i+1):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)

### FIXED CODE ###

n=int(input())
ans = 0
for i in range(1,n+1):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)
N, M = map(int,input().split())

class ID:
    def __init__(self,p,y,i):
        self.p = p
        self.y = y
        self.i = i
        self.IDed = False
        self.ID1 = None
        self.ID2 = None

    def ID(self):
        for i in range(1,6):
            if self.ID1 < 10**i:
                self.ID1 = "0"*(6-i) + str(self.ID1)
                break
        for i in range(1,6):
            if int(self.ID2) < 10**i:
                self.ID2 = "0"*(6-i) + str(self.ID2)
                break
        
        return self.ID1 + self.ID2

cities = []
for i in range(0,M):
    P,Y = map(int,input().split())
    cities.append(ID(P,Y,i))

for p in range(N+1,1,-1):
    pref = []
    for i in range(0,M):
        if not cities[i].IDed:
            if cities[i].p == p:
                pref.append([cities[i].y, cities[i].i])
                cities[i].IDed = True
    pref.sort()
    count = 1
    for i,j in pref:
        cities[j].ID2 = count
        count = count + 1
        cities[j].ID1 = p

for i in range(0,M):
    print(cities[i].ID())


### FIXED CODE ###

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

class ID:
    def __init__(self,p,y,i):
        self.p = p
        self.y = y
        self.i = i
        self.ID1 = None
        self.ID2 = None

    def ID(self):
        for i in range(1,7):
            if self.ID1 < 10**i:
                self.ID1 = "0"*(6-i) + str(self.ID1)
                break
        for i in range(1,7):
            if int(self.ID2) < 10**i:
                self.ID2 = "0"*(6-i) + str(self.ID2)
                break
        
        return self.ID1 + self.ID2

cities = []
for i in range(0,M):
    P,Y = map(int,input().split())
    cities.append(ID(P,Y,i))
cities.sort(key = lambda x: x.y)
counter = [-1]

for i in range(0,N):
    counter.append(1)

for c in cities:
    c.ID1 = c.p
    c.ID2 = counter[c.p]
    counter[c.p] = counter[c.p] + 1

cities.sort(key = lambda x: x.i)

for i in range(0,M):
    print(cities[i].ID())