Harryxun/stf_run huggingface dataset:
N = int(input())
S = input()

if N % 2 == 1:
  print("No")
  return
for i in range(N/2):
  if S[i] != S[N/2 + i]:
    print("No")
    return
print("Yes")


### FIXED CODE ###

N = int(input())
S = input()

ans = 1
if N % 2:
  ans = 0
else:
  for i in range(N//2):
    if S[i] != S[N//2 + i]:
      ans = 0
if ans:
  print("Yes")
else:
  print("No")
# encoding: utf-8

P_MAX = 100

num_and_pnt = lambda x: [int(x[0]), int(x[1]) // 100]

def mycounter(item, G):
    Gtmp = (item[1] + 1) * item[2] + item[3]
    p_th = item[2]
    for i in range(item[2]):
        if Gtmp < G: break
        else:
            p_th -= 1
            Gtmp = (item[1] + 1) * p_th
    return p_th + 1

D, G = num_and_pnt(input().split())

# [flag, index, pi, ci]
pc = [[1, i] + num_and_pnt(input().split()) for i in range(D)]

cnt = 0
while True:
    # last point
    # print(G * 100, cnt, pc)
    state = -1
    p_tmp = P_MAX
    for item in filter(lambda x: x[0] > 0, pc):
        Gtmp = (item[1] + 1) * item[2] + item[3]
        if G <= Gtmp:
            p = mycounter(item, G)
            if p < p_tmp:
                # print(G * 100, (item[1] + 1) * 100, p)
                state = item[1]
                p_tmp = p
    # escape
    if state > -1:
        cnt += p_tmp
        break
    # completed point
    # print(pc)
    item = max(flist(ilter(lambda x: x[0] > 0, pc), key=lambda x: x[1] + x[3] / x[2]))
    G -= (item[1] + 1) * item[2] + item[3]
    cnt += item[2]
    pc[item[1]][0] = 0
    
print(cnt)

### FIXED CODE ###

# encoding: utf-8
D_MAX = 10
P_MAX = 100

num_and_pnt = lambda x: [int(x[0]), int(x[1]) // 100]
D, G = num_and_pnt(input().split())
# [pi, ci]
pc = [num_and_pnt(input().split()) for i in range(D)]

G_list = [(i + 1) * x[0] + x[1] for i, x in enumerate(pc)]
cnt_list = [x[0] for i, x in enumerate(pc)]
idx = [map(int, format(i, "b")) for i in range(2 ** D)]

# i, G_comp, cnt_comp
table = [ (i, sum([((i // (2 ** j)) % 2) * G_list[j] for j in range(D)]), sum([((i // (2 ** j)) % 2) * cnt_list[j] for j in range(D)])) for i in range(2 ** D)] # very long
# print(table)
mincnt = D_MAX * P_MAX
for i, (G_last, cnt_last) in enumerate(zip(G_list, cnt_list)):
    for j, G_comp, cnt_comp in filter(lambda x: (((x[0] // (2 ** i)) % 2 == 0) and (x[1] <= G < x[1] + G_last) and (x[2] < mincnt)), table):
        # print(i, (G_last, cnt_last), j, G_comp, cnt_comp)
        cnt_last_tmp = min((-((G_comp - G) // (i + 1)), cnt_last))
        if cnt_comp + cnt_last_tmp < mincnt: mincnt = cnt_comp + cnt_last_tmp

print(mincnt)
n, m = map(int, input().split())
py = sorted([[i] + list(map(int, input().split())) for i in range(m)], key=lambda x:(x[1], x[2]))

city = py[1][2]
num = 0

for i in py:
    if i[1] == city:
        num += 1
    else:
        num = 1
        city = i[1]
    i.append(num)

py.sort()

for i in py:
    print('{:06}{:06}'.format(i[1], i[3]))

### FIXED CODE ###

n, m = map(int, input().split())
py = [[i] + list(map(int, input().split())) for i in range(m)]
py.sort(key=lambda x:(x[1],x[2]))

city = py[0][1]
num = 0

for i in py:
    if i[1] == city:
        num += 1
    else:
        city = i[1]
        num = 1
    i.append(num)

py.sort()

for i in py:
    print('{:06}{:06}'.format(i[1], i[3]))
A,B = map(int, input().split())
count = 0
for i in range(A, B+1):
  i = str(i)
  if i[0] == i[4] and i[1] == i[3]:
    count += 1
print(count)

### FIXED CODE ###

a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])
N = int(input)
print(N//3)

### FIXED CODE ###

N = int(input())
print(N//3)
C = [list(map(int, input().split())) for i in range(3)]

a = [0]
b = []
result = 'Yes'

b.append(C[0][0])
b.append(C[1][0])
b.append(C[2][0])
a.append(C[1][0] - b1)
a.append(C[2][0] - b1)

for i in range(3):
    for j in range(3):
        if C[i][j] != a[i] + b[j]:
            result = 'No'
            
print(result)


### FIXED CODE ###

C = [list(map(int, input().split())) for i in range(3)]

a = [0]
b = []
result = 'Yes'

b.append(C[0][0])
b.append(C[0][1])
b.append(C[0][2])
a.append(C[1][0] - b[0])
a.append(C[2][0] - b[0])

for i in range(3):
    for j in range(3):
        if C[i][j] != a[i] + b[j]:
            result = 'No'
            
print(result)
import sys
def inpl(): return list(map(int, sys.stdin.readline().split()))
sys.setrecursionlimit(410000)

x = inpl()
n = x[0]
k = x[1]
m = [0 for i in range(0, 200001)]
dic = [0 for i in range(0, 200001)]

A = inpl()

t = 0
i = 0
roop = 0
while True:
    if i == k:
        print(t + 1)
        break
    if m[t] == 0:
        m[t] = 1
        dic[t] = i
        t = A[t] -1
    else:
        roop = i - dic[t]
        break
    i += 1

for i in range(0, (k - i) % roop):
    t = A[t] - 1

print(t + 1)

### FIXED CODE ###

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
i = 0
visit = []
visit_set = set()
while i not in visit_set:
    visit.append(i)
    visit_set.add(i)
    i = A[i] - 1
find = visit.index(i)
if K < find:
    print(visit[K] + 1)
else:
    root = visit[find:]
    K = (K-find) % len(root)
    print(root[K] + 1)
n,k,q = map(int,input().split())
a_n = [int(input()) for i in range(q)]

p_n = [k-q for i in range(n)]

for a_i in a_n:
    p_n[a_i] += 1

[print("Yes") if p_i > 0 else print("No") for p_i in p_n]


### FIXED CODE ###

n,k,q = map(int,input().split())
a_n = [int(input()) for i in range(q)]

p_n = [k-q for i in range(n)]

for a_i in a_n:
    p_n[a_i-1] += 1

[print("Yes") if p_i > 0 else print("No") for p_i in p_n]
import math

N, H = map(int, input().split())
Swords_a = []
Swords_b = []
amax = 0
for i in range(N):
  
  a, b = map(int, input().split())
  Swords_a.append(a)
  Swords_b.append(b)
  
ma = max(Swords_a)
sb = 0 # bのうち「maより大きい成分」の和

Swords_a = sorted(Swords_a)
Swords_b = sorted(Swords_b)

c = 0
k = 0

for i in range(N):
  if ma < Swords_b[i]:
    sb += Swords_b[i]
    c += 1
  if sb >= H:
    k = c
    どーん！
    break

if sb < H:
  print(c + math.ceil((H-sb)/ma))
else:
  #こっちでWAになる
  print(k)

### FIXED CODE ###

import math

N, H = map(int, input().split())
Swords_a = []
Swords_b = []
for i in range(N):
  
  a, b = map(int, input().split())
  Swords_a.append(a)
  Swords_b.append(b)
  
ma = max(Swords_a)
sb = 0 # bのうち「maより大きい成分」の和

Swords_b = sorted(Swords_b, reverse = True)

c = 0
k = 0

for i in range(N):
  if ma < Swords_b[i]:
    sb += Swords_b[i]
    c += 1
  if sb >= H:
    k = c
    break

if sb < H:
  print(c + math.ceil((H-sb)/ma))
else:
  print(k)
n, a, b = map(int, input().split())

mod = 10 ** 9 + 7
g1 = [1, 1] # 元テーブル
g2 = [1, 1] # 逆元テーブル
inverse = [0, 1] # 逆元テーブル計算用テーブル

for i in range(2, max(a, b) + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((- inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

def nCr(n, r, mod):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod

p = 1000000007
total = (2 ** n - 1) % p
total = (total - nCr(n, a, p) - nCr(n, b, p)) % p
print(total)


### FIXED CODE ###

def abp(a, b, p):
    if b == 0:
        return 1
    if b % 2 == 0:
        tmp = abp(a, b // 2, p)
        return (tmp * tmp) % p
    if b % 2 == 1:
        return (a * abp(a, b - 1, p)) % p

def nCr(n, r, p):
    total = 1
    for i in range(r):
        total *= (n - i) * abp(r - i, p - 2, p)
        total %= p
    return total

n, a, b = map(int, input().split())
p = 1000000007
ret = abp(2, n, p) - nCr(n, a, p) - nCr(n, b, p) - 1
print(ret % p)
N = int(input())
keta = len(N)
cnt = 0

for i in range(keta):
    if i % 2 == 1:
        cnt += 10**(i) - 10**(i-1)

if keta % 2 == 1:
    cnt += N - 10**(keta-1) + 1

print(cnt)

### FIXED CODE ###

N = int(input())
keta = len(str(N))
cnt = 0

for i in range(keta):
    if i % 2 == 1:
        cnt += 10**(i) - 10**(i-1)

if keta % 2 == 1:
    cnt += N - 10**(keta-1) + 1

print(cnt)
N,K=map(int,input().split())

while R <= N:
  N = N // R
  a +=a

print(a)
  
  
  


### FIXED CODE ###

N,K=map(int,input().split())
a = 1
while K <= N:
  N = N // K
  a =a+1
  
print(a)
a,b,c=map(int,input().split)
print('YES') if a * b * c % 4 ==0 else print('No')

### FIXED CODE ###

a,b,c=list(map(int,input().split()))
print('YES') if (100*a+10*b+c)%4==0 else print('NO')
N = int(input())
A = []
ans = 0

for _ in range(N):
  A.append(int(input()))
  
A.sort()

if N == 1:
  print(1)
  
else:
  for i in range(N-2):
    if A[i] != A[i+1]:
      L = len(A[:i+1])
      del A[:i+1]
      if L%2 == 1:
        ans += 1
      
  print(ans)

### FIXED CODE ###

N = int(input())
A = []
count = 1
ans = 0

for _ in range(N):
  A.append(int(input()))

A.sort()

for i in range(N-1):
  if A[i] == A[i+1]:
    count += 1
  else:
    if count%2 == 1:
      ans += 1
    count = 1
else:
  if count%2 == 1:
    ans += 1
  else:
    count = 1

print(ans)
N, M = list(map(int, input().split()))
H_list = list(map(int, input().split()))
road_list = []

for _ in range(M):
    road_list.append([])
for i in range(M):
    a, b = list(map(int, input().split()))
    H_a, H_b = [H_list[a - 1], H_list[b - 1]]
    if H_a <= H_b:
        road_list[a - 1].append(a)
    elif H_b <= H_a:
        road_list[b - 1].append(b)

ans = 0
for road in road_list:
    if len(road) == 0:
        ans += 1
print(ans)

### FIXED CODE ###

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

road_list = []
for _ in range(N):
    road_list.append([])
    
for i in range(M):
    a, b = list(map(int, input().split()))
    
    H_a, H_b = [H_list[a - 1], H_list[b - 1]]
    
    if H_a <= H_b:
        road_list[a - 1].append(b)

    if H_b <= H_a:
        road_list[b - 1].append(a)

ans = 0
for road in road_list:
    if len(road) == 0:
        ans += 1
print(ans)
N=5000+1
p=[True]*N
p[0],p[1]=False,False
for i in xrange(2,int(N**0.5)+1):
    if p[i]==True:
        for j in xrange(i**2,N,i):
            p[j]=False
c=[0]*N
for i in xrange(N):
    for j in xrange(i/2+1):
        if p[j] and p[i-j]:c[i]+=1
while True:
    n=input()
    if n==0:break
    print c[n]

### FIXED CODE ###

import itertools
N=50000+1
p=[True]*N
p[0],p[1]=False,False
for i in xrange(2,int(N**0.5)+1):
    if p[i]==True:
        for j in xrange(i**2,N,i):
            p[j]=False
plist=[i for i in xrange(N) if p[i]]
c=[0]*N*2
for i,j in itertools.combinations(plist,2):
    c[i+j]+=1
for i in xrange(N):
    if p[i]:c[i+i]+=1
while True:
    n=input()
    if n==0:break
    print c[n]
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if N == 2:
        print(max(A[0]+A[1], (-A[0])+(-A[1])))
        return

    a_sum, a1, a2 = 0, A[0], A[1]
    b_sum, b1, b2 = 0, -A[0], -A[1]
    for i in range(2, N):
        #print(a_sum, a1, a2)
        #print(b_sum, b1, b2)
        #print(A[i])


        if (a_sum + a1 + a2 + A[i]) > (b_sum + b1 + b2 + A[i]):
            new_a_sum = a_sum + a1
            new_a1 = a2
            new_a2 = A[i]
        else:
            new_a_sum = b_sum + b1
            new_a1 = b2
            new_a2 = A[i]
        a_sum, a1, a2 = new_a_sum, new_a1, new_a2
        b_sum, b1, b2 = new_b_sum, new_b1, new_b2

    print(max(a_sum+a1+a2, b_sum+b1+b2))

main()


### FIXED CODE ###

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

    if N == 2:
        print(max(A[0]+A[1], (-A[0])+(-A[1])))
        return

    a_sum, a1, a2 = 0, A[0], A[1]
    b_sum, b1, b2 = 0, -A[0], -A[1]
    for i in range(2, N):
        #print(a_sum, a1, a2)
        #print(b_sum, b1, b2)
        #print(A[i])
        

        if (a_sum + a1 + a2 + A[i]) > (b_sum + b1 + b2 + A[i]):
            new_a_sum = a_sum + a1
            new_a1 = a2
            new_a2 = A[i]
        else:
            new_a_sum = b_sum + b1
            new_a1 = b2
            new_a2 = A[i]

        if (a_sum + a1 - a2 - A[i]) > (b_sum + b1 - b2 - A[i]):
            new_b_sum = a_sum + a1
            new_b1 = -a2
            new_b2 = -A[i]
        else:
            new_b_sum = b_sum + b1
            new_b1 = -b2
            new_b2 = -A[i]

        a_sum, a1, a2 = new_a_sum, new_a1, new_a2
        b_sum, b1, b2 = new_b_sum, new_b1, new_b2
        
    print(max(a_sum+a1+a2, b_sum+b1+b2))

main()
n = []
while True:
    c = list(raw_input().lower())
    if c == []:
        break
    n.append(c)

a = ""
for i in n:
    a = a + "".join(i)
n = list(a)
charac = []
for j in range(97,97+26):
    m= 0
    for i in range(0,len(n)):
        if ord(n[i]) == j:
            m += 1
        charac.append("{} : {}".format(chr(j),m))

for i in range(0,26):
    print(charac[i])

### FIXED CODE ###

s =""
while True:
    try:
        s += input().lower()
    except:
        break
    
s = list(map(ord,list(s)))
for i in range(ord("a"),ord("z")+1):
    print(chr(i) + " : " + str(s.count(i)))
N,M = map(int,input().split())
lis = []
path = ["1"]

for i in range(M):

    a,b = map(int,input().split())
    lis.append([a,b])

for i in range(N-1):

    i += 1

    npath = []

    for p in path:


        for j in lis:

            if j[0] == int(p[-1]) and str(j[1]) not in p:

                npath.append(p + str(j[1]))

            if j[1] == int(p[-1]) and str(j[0]) not in p:

                npath.append(p + str(j[0]))

    path = npath.copy()


print (len(path))

### FIXED CODE ###


N,M = map(int,input().split())
lis = []
path = ["1"]

for i in range(M):

    a,b = map(int,input().split())
    lis.append([a,b])

for i in range(N-1):

    i += 1

    npath = []

    for p in path:


        for j in lis:

            if j[0] == int(p[-1]) and str(j[1]) not in p:

                npath.append(p + str(j[1]))

            if j[1] == int(p[-1]) and str(j[0]) not in p:

                npath.append(p + str(j[0]))

    path = npath.copy()


print (len(path))
while True:
    H, W =[int(i) for i in input().split ]
    if H == W == 0:
       break
 
    for h in range(H):
        for w in range(W):
            if h == 0 or h == h -1 or w == 0 or w == W - 1:
               print('#', end='')
            else:
                print('.', end='')
 
        print()
 
    print()

### FIXED CODE ###

while True:
    H, W = [int(i) for i in input().split()]
    if H == W == 0:
        break
    for h in range(H):
        for w in range(W):
            if h == 0 or h == H - 1 or w == 0 or w == W - 1:
                print('#', end='')
            else:
                print('.', end='')
        print()
    print()
import math

class Point():

    def __init__(self, x, y):
        self.x = x
        self.y = y

x1, y1, x2, y2 = [int(i) for i in input().split()]

point1 = Point(x1, y1)
point2 = Point(x2, y2)

x_dist = point1.x - point2.x
y_dist = point1.y - point2.y

dist = math.sqrt(x_dist ** 2 + y_dist ** 2)

print(dist)


### FIXED CODE ###

import math

class Point():

    def __init__(self, x, y):
        self.x = x
        self.y = y

x1, y1, x2, y2 = [float(i) for i in input().split()]

point1 = Point(x1, y1)
point2 = Point(x2, y2)

x_dist = point1.x - point2.x
y_dist = point1.y - point2.y

dist = math.sqrt(x_dist ** 2 + y_dist ** 2)

print(dist)
x=input()
x1=len(x)
x2 = x1 / 2
if x1 %2 == 0
	if "hi"*x2 == s:
		print("Yes")
	else
		print("No")
else:
  print("No")


### FIXED CODE ###

x=input()
if x == 'hi':
	print('Yes')
elif x == 'hihi':
	print('Yes')
elif x == 'hihihi':
	print('Yes')
elif x == 'hihihihi':
	print('Yes')
elif x == 'hihihihihi':
	print('Yes')
else:
	print('No')
n = int(input())
k = int(input())
x = int(input())
y = int(input())

f_normal = x * k
f_addition = f_formal + (n - k) * y

if n <= k:
  print(f_normal)
else:
  print(f_addition)

### FIXED CODE ###

n = int(input())
k = int(input())
x = int(input())
y = int(input())

f_normal = x * n
f_addition = x * k  + y * (n - k)

if n <= k:
  print(f_normal)
else:
  print(f_addition)
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A,B,C,D = map(int,input().split())
A -= 1

E = lcm(C,D)

print(B - B // C - B // D + B // E - (A - A // C - A // D + A // E))

### FIXED CODE ###

import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

A,B,C,D = map(int,input().split())
A -= 1

E = lcm(C,D)

print(B - B // C - B // D + B // E - (A - A // C - A // D + A // E))
H, N= map(int,input().split())
A = [0] * N
B = [0] * N
for i in range(N):
    A[i], B[i] = map(int, input().split())
ma = max(A)
dp = [float("inf")] * (H + ma)
dp[0] = 0
for i in range(N):
    a = A[i]
    b = B[i]
    for j in range(1, H + ma):
        dp[j] = min(dp[j - a] + b, dp[j])
print(min(dp[H:]))


### FIXED CODE ###

H, A = map(int,input().split())
if H % A == 0:
    print(H // A)
else:
    print(H // A + 1)
a,b,c,d=map(int,input().split())
if b<=c or a=>d:
  t=0
else:
  if a<=c:
    if b<d:
      t=b-c
    else:
      t=d-c
  else:
    if c<d:
      t=b-a
    else:
      t=d-a
print(t)
  

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if b<=c or a>=d:
  t=0
else:
  if a<=c:
    if b<d:
      t=b-c
    else:
      t=d-c
  else:
    if b<d:
      t=b-a
    else:
      t=d-a
print(t)
N = int(input())
mod = 10**9+7
s = [0] * (n+1)

for i in range(2, n+1):
    p = 2
    while i>1:
        while i%p==0:
            i //= p
            s[p] += 1
        p += 1

print(s)
ans = 1
for i in s:
    ans *= i+1
    ans %= mod

print(ans)

### FIXED CODE ###

n = int(input())
mod = 10**9+7
s = [0] * (n+1)

for i in range(2, n+1):
    p = 2
    while i>1:
        while i%p==0:
            i //= p
            s[p] += 1
        p += 1

ans = 1
for i in s:
    ans *= i+1
    ans %= mod

print(ans)
def tax(p,x):
    return p*(100+x)//100
def solve(X, Y, S):
    max_value=0 #max_valueをdef solveの前に入れるミスをしていて全く進みませんでした。関数の定義の理解が進みました。
    for a in range(1,S):
        for b in range(1,S):
            sum_value=tax(a,X)+tax(b,X)
            if sum_value==S:
                c=tax(a,Y)+tax(b,Y)
                if c>=max_value:
                    max_value=c
                if sum_value>S:　#bが増加すれば必ずSが増加することを使っていて、なるほどと思いました。
                    break
    return max_value

while True:
    X,Y,Z=map(int, input().split())
    if X==0:
        break
    print(solve(X,Y,Z))
#リダイレクションのやり方がわかりませんでした


### FIXED CODE ###

def tax(p,x):
    return p*(100+x)//100
def solve(X, Y, S):
    max_value=0 #max_valueをdef solveの前に入れるミスをしていて全く進みませんでした。関数の定義の理解が進みました。
    for a in range(1,S):
        for b in range(1,S):
            sum_value=tax(a,X)+tax(b,X)
            if sum_value==S:
                c=tax(a,Y)+tax(b,Y)
                if c>max_value:#最初は>=にしてたのですが、> にすることで高速化を図れました
                    max_value=c
                if sum_value>S: #bが増加すれば必ずSが増加することを使っていて、なるほどと思いました。
                    break
    return max_value

while True:
    X,Y,Z=map(int, input().split())
    if X==0:
        break
    print(solve(X,Y,Z))
#runtime errorになりましたが、ジャッジングデータと結果が一致しました。制限時間内に解く方法がわかりませんでした。
#右・中央の座席
N, K = map(int, input().split())
*H, = map(int, input().split())
 
Cost = N*[float("inf")]
Cost[0] = 0
 
for i in range(1, N):
    if i == 1:
        Cost[1] = Cost[0] + abs(H[0]-H[1])
        continue
 
    Cost[i] = min([Cost[i-u] + abs(h[i-u]-h[i]) for u in range(1, K+1)])
 
print(Cost[N-1])

### FIXED CODE ###

def main():
    infinity = 1e10

    n, k, height = getInputs()

    cost = [infinity] * n
    cost[0] = 0
    cost[1] = abs(height[0] - height[1])

    for i in range(2, n):
        for j in range(i - 1, i - k - 1, -1):
            if j >= 0:
                cost[i] = min(cost[i], cost[j] + abs(height[i] - height[j]))

    print(cost[-1])

def getInputs():
    n, k = map(lambda x: int(x), input().split())
    height = tuple(map(lambda x: int(x), input().split()))

    return n, k, height

main()
#nm=list(map(int,input().split()))
#n=nm[0]
#m=nm[1]
n,m=map(int,input().split())
#py=[]
y=[]
#py=[[[]]*m]
py=[[]]*m
#y=[[]]*n
#print(py)
#for i in range(m):
#    py.append([])
for i in range (n):
    y.append([])
for i in range(m):
    py[i]=list(map(int,input().split()))
    y[py[i][0]-1].append(py[i][1])#yの初期化を＊でするとyの要素全てにappendされてしまう
for i in range(n):
    y[i].sort()
#print(py)
#print(y)
d_y={}
for i in range(m):
    for j in range(len(y[i])):
        d_y[y[i][j]]=j+1
for i in range(m):
    if py[i][0]<10:
        print("00000"+str(py[i][0]*10**6+d_y[py[i][1]]))
    elif  py[i][0]<100:
        print("0000"+str(py[i][0]*10**6+d_y[py[i][1]]))
    elif py[i][0]<1000:
        print("000"+str(py[i][0]*10**6+d_y[py[i][1]]))
    elif py[i][0]<10000:
        print("00"+str(py[i][0]*10**6+d_y[py[i][1]]))
    elif py[i][0]<100000:
        print("0"+str(py[i][0]*10**6+d_y[py[i][1]]))
    else:
        print(str(py[i][0]*10**6+d_y[py[i][1]]))


### FIXED CODE ###

#nm=list(map(int,input().split()))
#n=nm[0]
#m=nm[1]
n,m=map(int,input().split())
#py=[]
y=[]
#py=[[[]]*m]
py=[[]]*m
#y=[[]]*n
#print(py)
#for i in range(m):
#    py.append([])
for i in range (n):
    y.append([])
for i in range(m):
    py[i]=list(map(int,input().split()))
    y[py[i][0]-1].append(py[i][1])#yの初期化を＊でするとyの要素全てにappendされてしまう
for i in range(n):
    y[i].sort()
#print(py)
#print(y)
d_y={}
for i in range(n):
    for j in range(len(y[i])):
        d_y[y[i][j]]=j+1
for i in range(m):
    if py[i][0]<10:
        print("00000"+str(py[i][0]*10**6+d_y[py[i][1]]))
    elif  py[i][0]<100:
        print("0000"+str(py[i][0]*10**6+d_y[py[i][1]]))
    elif py[i][0]<1000:
        print("000"+str(py[i][0]*10**6+d_y[py[i][1]]))
    elif py[i][0]<10000:
        print("00"+str(py[i][0]*10**6+d_y[py[i][1]]))
    elif py[i][0]<100000:
        print("0"+str(py[i][0]*10**6+d_y[py[i][1]]))
    else:
        print(str(py[i][0]*10**6+d_y[py[i][1]]))
n=int(input())
def d(n):
    return "Yes" if 7 in n else ""No"
print(d(n))

### FIXED CODE ###

N=input()
def d(N):
    return "Yes" if "7" in N else "No"
print(d(N))
a,b,m=map(int,input().split())
al=list(map(int,input().split()))
bl=list(map(int,input().split()))
x=min(al)+min(bl)
for i in range(m):
  x,y,c=map(int,input().split())
  t=a[x-1]+b[y-1]-c
  x=min(x,t)
print(x)

### FIXED CODE ###

a,b,m=map(int,input().split())
al=list(map(int,input().split()))
bl=list(map(int,input().split()))
z=min(al)+min(bl)
for i in range(m):
  x,y,c=map(int,input().split())
  t=al[x-1]+bl[y-1]-c
  z=min(z,t)
print(z)
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

### FIXED CODE ###

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

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a


def lcm(a, b):
	return a * b // gcd (a, b)


print(lcm(a,b))
N, M = map(int, input().split())  #数字
H = list(map(int, input().split()))#リスト
A = [list(map(int, input().split())) for i in range(M)]  #数字、複数行複数列

good = [True]*N
for i in range(M):
    left = H[A[i][0] - 1]
    right = H[A[i][1] - 1]
    if left < right:
        good[A[i][0]] = False
    if left > right:
        good[A[i][1]] = False
    if left == right:
        good[A[i][0]] = False
        good[A[i][1]] = False

print(good.count(True))

### FIXED CODE ###

N, M = map(int, input().split())  #数字
H = list(map(int, input().split()))#リスト
A = [list(map(int, input().split())) for i in range(M)]  #数字、複数行複数列

good = [True]*N
for i, j in A:
    i -= 1
    j -= 1
    if H[i] < H[j]:
        good[i] = False
    if H[i] > H[j]:
        good[j] = False
    if H[i] == H[j]:
        good[i] = False
        good[j] = False

print(good.count(True))
a = input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if len(set(a))==26:
  pritn('None')
else:
  for i in range(len(l)):
    if l[i] not in a:
      print(l[i])
      break

### FIXED CODE ###

a = input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if len(set(a))==26:
  print('None')
else:
  for i in range(len(l)):
    if l[i] not in a:
      print(l[i])
      break
n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(b))

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))
A,B = map(input().split())

if A%3==0 or B%3==0 or (A+B)%3==0:
  print("Possible")
else:
  print("Impossible")

### FIXED CODE ###

a = list(map(int,input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print("Possible")
else:
  print("Impossible")