qyliang/CodeNanoFix huggingface dataset:
Buggy code:
X, Y = [int(x) for x in input().split()]
print(int(X) + int(Y) / 2)

Fixed code:
X, Y = [int(x) for x in input().split()]
print(X + Y // 2)
Buggy code:
X,Y=map(int,input().split())
Z=X+Y/2
print(Z)

Fixed code:
(X, Y) = map(int, input().split())

print(X+Y//2)
Buggy code:
a,b = map(int,input().split())
print(b/2+a)

Fixed code:
a, b = list(map(int, input().split()))

print(a+(b//2))
Buggy code:
X, Y = map(int, input().split())
print((X + (Y / 2))//1)

Fixed code:
X, Y = map(int, input().split())

print(X+Y//2)
Buggy code:
a,b = list(map(int,input().split())
print(a+b//2)

Fixed code:
a,b = map(int, input().split())
print(a + b//2)
Buggy code:
#!usr/bin/env python
# -*- coding: utf-8 -*-
X , Y = int(input()), int(input())
print("{}".format(X+Y//2))

Fixed code:
#!usr/bin/env python
# -*- coding: utf-8 -*-
X , Y= map(int,input().split())
print("{}".format(X + Y // 2))
Buggy code:
X, Y = map(int, input().split())

print(X + Y/2)

Fixed code:
X,Y = map(int, input().split())
print(X + (Y // 2))
Buggy code:
x, y = list(map(int, input().split()))

print(x+y/2)

Fixed code:
x, y = map(int, input().split())
print(int(x + (y//2)))
Buggy code:
a,b = map(int, input().split())
print(a+b/2)

Fixed code:
a,b = map(int, input().split())
print(a+(b//2))
Buggy code:
X,Y=map(int,input().split)
print(int(X+Y/2))


Fixed code:
X, Y = map(int,input().rstrip().split())
print(X+Y//2)
Buggy code:
X, Y = map(int, input().split())

ans = X + (Y / 2)

print(ans)

Fixed code:
X, Y = map(int, input().split())
print(X + (Y // 2))
Buggy code:
a,b = [int(_) for _ in input().split()]
print(a + b/2)

Fixed code:
a,b = [int(_) for _ in input().split()]
print(a + b//2)
Buggy code:
x,y = map(int,input().split())
print(x + y/2)

Fixed code:
x,y = map(int,input().split())
print( x + y//2)
Buggy code:
from sys import stdin

x, y = list(map(int, stdin.readline().split()))
print(x + y/2)

Fixed code:
from sys import stdin

x, y = list(map(int, stdin.readline().split()))
print(x + y//2)
Buggy code:
a, b = (int(i) for i in input().split())
print(a+b/2)

Fixed code:
a, b = (int(i) for i in input().split())
print(b//2+a)
Buggy code:
x, y = map(int, input().split())
a = x + y/2
print(a)

Fixed code:
x, y = map(int,input().split())
print((x + y // 2))
Buggy code:
X,Y = map(int,input().split())
print(X+Y/2)

Fixed code:
X, Y = map(int,input().split())
ans = X + Y//2
print(ans)
Buggy code:
a,b = map(int, input().rstrip().split())


print(a + b/2)

Fixed code:
a, b = map(int, input().split())
print(a+(b//2))
Buggy code:
A, B = list(map(int, input().split()))
print(A + (B / 2))

Fixed code:
A, B = list(map(int, input().split()))
print(A + (B // 2))
Buggy code:
X, Y = [int(i) for i in input().split()]
ans = X + Y/2
print(ans)


Fixed code:
X, Y = [int(i) for i in input().split()]
ans = X + Y//2
print(ans)
Buggy code:
a,b = map(int,input().split())

print(a+b/2)




Fixed code:
a,b=map(int,input().split())
c=a+b//2
print(c)
Buggy code:
x,y =map(int,input().split())
print(x+y/2)

Fixed code:
x,y =map(int,input().split())
print(x + y//2)
Buggy code:
X, Y = map(int, input().split())
print(X+Y/2)


Fixed code:
X, Y = map(int, input().split())

print(X+(Y//2))
Buggy code:
a,b= map(int, input().split())
print(a+b/2)

Fixed code:
a,b=map(int,input().split());print(a+(b//2))
Buggy code:
import sys

def solve (a,b):
    c=int(b)//2
    D=int(a)+int(c)
    print(D)
    
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    a = int(ws[0])
    b = int(ws[1])
    return (a, b)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
 main()


Fixed code:
import sys

def solve(a, b):
    return(int(a)+int(b)//2)


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    a = int(ws[0])
    b = int(ws[1])
    return (a, b)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
main()
Buggy code:
X,Y = map(int,input().split())
print(X + Y / 2)

Fixed code:
X, Y = map(int, input().split())
print(X +Y//2)
Buggy code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


n,k = map(int,input().split())

print(x+y//2)

Fixed code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


n,k = map(int,input().split())

print(n+k//2)
Buggy code:

x, y = map(int, input().split())

print(x + y/2)



Fixed code:
x, y = list(map(int, input().split()))

print(x + y // 2)
Buggy code:
X,Y=map(int,input().split())
cost=X+Y/2
print(cost)

Fixed code:
X,Y = map(int, input().split())
print(X + (Y//2))
Buggy code:
a,b=map(int,input().split())
print(a+(b/2))


Fixed code:
a, b = map(int, input().split())
print(a + b//2)
Buggy code:
x,y  = map(int, input().split())
print(x+y/2)

Fixed code:
x, y =map(int, input().split())
print(x+y//2)
Buggy code:
X,Y = map(int,input().split())
print(X + (Y/2))

Fixed code:
X, Y = map( int, input().split())
print(X+Y//2)
Buggy code:
X,Y=map(int,input().split())

print(X+Y/2)


Fixed code:
X, Y = map(int,input().split())
print(Y // 2 + X)
Buggy code:
x, y = map(int,input().split())

print(x + (y / 2))


Fixed code:
x,y = map(int, input().split())
print(str(x+y//2))
Buggy code:
X, Y = map(int, input.split())

a = X + Y/2

print(a)

Fixed code:
X,Y = map(int,input().split())
print(X+Y//2)
Buggy code:
a,b = map(int,input().split())
print(a + (b/2))


Fixed code:
a,b = map(int,input().split())
print(a + b//2)
Buggy code:
x,y=map(int,input().split())
a=x+y/2
print(a)

Fixed code:
x,y=map(int,input().split())
a=x+y//2
print(a)
Buggy code:
X, Y = map(int, input().split())

print(X + (Y / 2))


Fixed code:
X, Y = map(int, input().split())

R = X + Y // 2

print(R)
Buggy code:
x,y=map(int, input().split())
print(x+y/2)

Fixed code:
x,y=map(int,input().split())
s=x+y//2
print(s)
Buggy code:
x,y=(int(i) for  i in input().split(' ')
print(x+y//2)

Fixed code:
x,y=(int(i) for  i in input().split(' '))
print(x+y//2)
Buggy code:
X, Y =map(int, input().split())
print(X + Y/2)

Fixed code:
X, Y = map(int, input().split())
print(X+Y//2)
Buggy code:
def solve():
    x, y = map(int, input())
    return x + y // 2


if __name__ == "__main__":
    print(solve())


Fixed code:
def solve():
    x, y = map(int, input().split())
    return x + y // 2


if __name__ == "__main__":
    print(solve())
Buggy code:
x, y = map(int, input().split())
print(x+(y/2))


Fixed code:
x,y= map(int, input().split()); print(x+y//2)
Buggy code:
a, b = map(int, input().split())
 
print(a + (b / 2))

Fixed code:
a,b = map(int, input().split())
print(a+b//2)
Buggy code:
x,y = map(int(input().split()))
print(x+y//2)

Fixed code:
x,y=map(int, input().split())

print(x+y//2)
Buggy code:
X,Y=map(int, input().split())

print(X+Y/2)

Fixed code:
X,Y = map(int, input().split())
print(X + Y//2)
Buggy code:
X, Y = map(int, input().split())

print(X+(Y/2))

Fixed code:
X, Y = map(int, input().split())

print(X + (Y // 2))
Buggy code:
x, y = list(map(int, input().split()))
print(x+y/2)

Fixed code:
x,y=map(int, input().split())
print(x+y//2)
Buggy code:

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

print(X+Y/2)

Fixed code:
X,Y=map(int,input().split())

print(X+Y//2)
Buggy code:
X,Y = map(int, input().split())
Y = 2/Y
print(int X + Y/2)

Fixed code:
X,Y=tuple(map(int,input().split()))
print(X+Y//2)
Buggy code:
x, y = map(int,input().split())

print(x + y/2)


Fixed code:
x,y = map(int,input().split())
ans = x + (y // 2)
print(ans)
Buggy code:
a,b=map(int, input().split())
print(a+b/2)

Fixed code:
a,b = map(int,input().split())
print(a+b//2)
Buggy code:
X, Y = map(int, input().split())
print(X+(Y/2))

Fixed code:
X, Y = map(int, input().split())
# print(X, Y)
print(X + Y // 2)
Buggy code:
x,y = map(int,input().split())
print(x+y/2)


Fixed code:
x, y = map(int, input().split())
z = x + (y // 2)
print(z)
Buggy code:
x, y = map(int, input().split())
               
print(x + y / 2)


Fixed code:
x, y = list(map(int, input().split()))
print(x + y // 2)
Buggy code:
x,y = map(int,input().split())
result = x+(y/2)
print(result)

Fixed code:
x,y = map(int, input().split())
print(x+(y//2))
Buggy code:
import functools
import math

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


print(inp() + inp() // 2)

Fixed code:
import functools
import math

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


x, y = inl()
print(x+y // 2)
Buggy code:
N,M = map(int,input().split())
PY = [list(map(int,input().split())) + [i] for i in range(M)]

PY.sort()
print(PY)

pnow = PY[0][0]
c = 1

ans = [-1 for i in range(M)]

for i in range(M):
    if pnow != PY[i][0]:
        c = 1
        pnow = PY[i][0]
    ans[PY[i][2]] = str(PY[i][0]).zfill(6) + str(c).zfill(6)
    c += 1

print('\n'.join(ans))


Fixed code:
N,M = map(int,input().split())
PY = [list(map(int,input().split())) + [i] for i in range(M)]

PY.sort()

pnow = PY[0][0]
c = 1

ans = [-1 for i in range(M)]

for i in range(M):
    if pnow != PY[i][0]:
        c = 1
        pnow = PY[i][0]
    ans[PY[i][2]] = str(PY[i][0]).zfill(6) + str(c).zfill(6)
    c += 1

print('\n'.join(ans))
Buggy code:
import bisect
N,M = map(int,input().split())
PtoY = [[] for n in range(N)]
check = []
for m in range(M):
    P,Y = map(int,input().split())
    PtoY[P-1].append(Y)
    check.append([P,Y])
print(check)
for n in range(N):
    PtoY[n].sort()
print(PtoY)
for m in range(M):
    p,y = check[m][0],check[m][1]
    a = bisect.bisect_left(PtoY[p-1],y)+1
    string = str(p).zfill(6) + str(a).zfill(6)
    print(string)


Fixed code:
from bisect import bisect_left
N,M = map(int,input().split())
PtoY = [[] for n in range(N)]
check = []
for m in range(M):
    P,Y = map(int,input().split())
    PtoY[P-1].append(Y)
    check.append([P,Y])
for n in range(N):
    PtoY[n].sort()
for m in range(M):
    p,y = check[m][0],check[m][1]
    a = bisect_left(PtoY[p-1],y)+1
    string = str(p).zfill(6) + str(a).zfill(6)
    print(string)
Buggy code:
import bisect
n,m = map(int,input().split())

l1 = [[] for i in range(n)]
l2 = []

for i in range(m):
    p,y = map(int,input().split())
    l1[p-1].append(y)
    l2.append((p,y))

for p in range(n):
    l1[p].sort()

for i in range(m):
    p = l2[i][0]
    k = bisect.right(l1[p-1],l2[i][1])
    p = str(p)
    k = str(k)
    ans = "0"*(6-len(p))+p+"0"*(6-len(k))+k
    print(ans)


Fixed code:
import bisect
n,m = map(int,input().split())

l1 = [[] for i in range(n)]
l2 = []

for i in range(m):
    p,y = map(int,input().split())
    l1[p-1].append(y)
    l2.append((p,y))

for p in range(n):
    l1[p].sort()

for i in range(m):
    p = l2[i][0]
    k = bisect.bisect_right(l1[p-1],l2[i][1])
    p = str(p)
    k = str(k)
    ans = "0"*(6-len(p))+p+"0"*(6-len(k))+k
    print(ans)
Buggy code:
s=input().split()
n,m=int(s[0]),int(s[1])
l=[[] for i in range(100001)]
d=[{} for i in range(100001)]
inp=[]
for i in range(m):
    s=input().split()
    p,y=int(s[0]),int(s[1])
    inp.append((p,y))
    l[p].append(y)
for i in range(100001):
    l[i].sort()
for i in range(100001):
    cnt=1
    for j in l[i]:
        d[i][j]=cnt
        cnt+=1
for pa in inp:
    print(str(pa[0]).zfill(6)+str(d[pa[0]-1][pa[1]]).zfill(6))

Fixed code:
s=input().split()
n,m=int(s[0]),int(s[1])
l=[[] for i in range(100001)]
d=[{} for i in range(100001)]
inp=[]
for i in range(m):
    s=input().split()
    p,y=int(s[0]),int(s[1])
    inp.append((p,y))
    l[p].append(y)
for i in range(100001):
    l[i].sort()
for i in range(100001):
    cnt=1
    for j in l[i]:
        d[i][j]=cnt
        cnt+=1
for pa in inp:
    print(str(pa[0]).zfill(6)+str(d[pa[0]][pa[1]]).zfill(6))
Buggy code:
n, m = map(int, input().split())

city_list = []
for i in range(m):
	p, y = map(int, input().split())
	city_list.append([i, p, y, 0])

print(city_list)
city_list = sorted(city_list, key = lambda x: x[2])
print(city_list)
city_list = sorted(city_list, key = lambda x: x[1])
print(city_list)

nowp = 1
index = 1
for city in city_list:
	if city[1] == nowp:
		city[3] = index
		index += 1
	else:
		nowp = city[1]
		index = 1
		city[3] = index
		index += 1

print(city_list)
city_list = sorted(city_list, key = lambda x: x[0])
print(city_list)

for city in city_list:
	kami_str = '0' * (6 - len(str(city[1]))) + str(city[1])
	shimo_str = '0' * (6 - len(str(city[3]))) + str(city[3])
	answer = kami_str + shimo_str
	print(answer)


Fixed code:
n, m = map(int, input().split())

city_list = []
for i in range(m):
	p, y = map(int, input().split())
	city_list.append([i, p, y, 0])

city_list = sorted(city_list, key = lambda x: x[2])
city_list = sorted(city_list, key = lambda x: x[1])

nowp = 1
index = 1
for city in city_list:
	if city[1] == nowp:
		city[3] = index
		index += 1
	else:
		nowp = city[1]
		index = 1
		city[3] = index
		index += 1

city_list = sorted(city_list, key = lambda x: x[0])

for city in city_list:
	kami_str = '0' * (6 - len(str(city[1]))) + str(city[1])
	shimo_str = '0' * (6 - len(str(city[3]))) + str(city[3])
	answer = kami_str + shimo_str
	print(answer)
Buggy code:
import sys
input = sys.stdin.readline

import collections, bisect

n, m = map(int, input().split())
p = [[int(j) for j in input().split()] for i in range(m)]
a = collections.defaultdict(list)
for x, y in sorted(p):
  a[x] += [y]
for x, y in sorted(p):
  z = bisect.bisect(a[x], y)
  print("%06d%06d"%(x,z))
  


Fixed code:
import sys
input = sys.stdin.readline

import collections, bisect

n, m = map(int, input().split())
p = [[int(j) for j in input().split()] for i in range(m)]
a = collections.defaultdict(list)
for x, y in sorted(p):
  a[x] += [y]
for x, y in p:
  z = bisect.bisect(a[x], y)
  print("%06d%06d"%(x,z))
Buggy code:
import sys

input = sys.stdin.readline
N,M = map(int,input().split())
PY = {n: [] for n in range(N + 1)}
ans = [0]*M
for i in range(M):
  p,y = map(int,input().split())
  PY[p].append((y, i))
print(PY)
for p,y in PY.items():
  y.sort()
  for j, (z, i) in enumerate(y):
    top_number = '0'*(6-len(str(p)))+str(p)
    under_number = '0'*(6-len((str(j+1))))+str(j+1)
    ans[i] = top_number + under_number
for i in range(M):
  print(ans[i])

Fixed code:
N,M = map(int,input().split())
PY = {n: [] for n in range(N + 1)}
ans = [0]*M
for i in range(M):
  p,y = map(int,input().split())
  PY[p].append((y, i))
for p,y in PY.items():
  y.sort()
  for j, (z, i) in enumerate(y):
    top_number = '0'*(6-len(str(p)))+str(p)
    under_number = '0'*(6-len((str(j+1))))+str(j+1)
    ans[i] = top_number + under_number
for i in range(M):
  print(ans[i])
Buggy code:
t=input()
N=int(t.split()[0])
M=int(t.split()[1])

city=[0]*M
for i in range(M):
  te=[int(x) for x in input().split()]
  city[i]={'i':i+1,'p':int(te[0]),'y':int(te[1])}

city_sorted = sorted(city,key = lambda x: (x['p'], x['y']))

x=0
temp_p=city_sorted[0]['p']
for c in city_sorted:
  if temp_p == c['p']:
    x+=1
  else:
    print("hoge")
    temp_p=c['p']
    x=1
  c['id']="{0:06d}{1:06d}".format(c['p'],x)
  
for ci in city:
  print(ci['id'])
  

Fixed code:
t=input()
N=int(t.split()[0])
M=int(t.split()[1])

city=[0]*M
for i in range(M):
  te=[int(x) for x in input().split()]
  city[i]={'i':i+1,'p':int(te[0]),'y':int(te[1])}

city_sorted = sorted(city,key = lambda x: (x['p'], x['y']))

x=0
temp_p=city_sorted[0]['p']
for c in city_sorted:
  if temp_p == c['p']:
    x+=1
  else:
    temp_p=c['p']
    x=1
  c['id']="{0:06d}{1:06d}".format(c['p'],x)
  
for ci in city:
  print(ci['id'])
Buggy code:
n,m=map(int,input().split())
lst=[]
for i in range(m):
  p,y=map(int,input().split())
  lst.append([p,y])
lst.sort(lambda x:(x[0],x[1]))
j=1
for i in range(m):
  if lst[i][0]==lst[min(m-1,i+1)][0]:
    s=str(lst[i][0])
    t=str(j)
    s.zfill(6)
    t.zfill(6)
    u=s+t
    j+=1
    print(int(u))
  else:
    s=str(lst[i][0])
    t=str(j)
    s.zfill(6)
    t.zfill(6)
    u=s+t
    j-=j-1
    print(int(u))
    
  


Fixed code:
n,m=map(int,input().split())
lst=[]
for i in range(m):
  p,y=map(int,input().split())
  lst.append([i,p,y])
lst.sort(key=lambda x:(x[1],x[2]))
j=1
Lst=[]
for i in range(m):
  if lst[i][1]==lst[min(m-1,i+1)][1]:
    s=str(lst[i][1])
    t=str(j)
    u=s.zfill(6)+t.zfill(6)
    j+=1
    Lst.append([lst[i][0],u])
  else:
    s=str(lst[i][1])
    t=str(j)
    u=s.zfill(6)+t.zfill(6)
    j-=j-1
    Lst.append([lst[i][0],u])
Lst.sort(key=lambda x:x[0])
for k in range(m):
  print(Lst[k][1])
Buggy code:
n,m=map(int, input().split())
l = [[int(i) for i in input().split()] for i in range(m)]

for i in range(m):
    l[i].append(i)
l = sorted(l,key=lambda x: (x[0],x[1]))

l[0].append(1)
for i in range(1,m):
    if l[i][0]!=l[i-1][0]:
        l[i].append(1)
    else:
        l[i].append(l[i-1][3]+1)

for i in range(m):
    l[i].append(str(l[i][0]).zfill(6) + l[i][3].zfill(6))

l=sorted(l,key=lambda x:(x[2]))

for i in range(m):
    print(l[i][4])

Fixed code:
n,m=map(int, input().split())
l = [[int(i) for i in input().split()] for i in range(m)]

for i in range(m):
    l[i].append(i)
l = sorted(l,key=lambda x: (x[0],x[1]))

l[0].append(1)
for i in range(1,m):
    if l[i][0]!=l[i-1][0]:
        l[i].append(1)
    else:
        l[i].append(l[i-1][3]+1)

for i in range(m):
    l[i].append(str(l[i][0]).zfill(6) + str(l[i][3]).zfill(6))

l=sorted(l,key=lambda x:(x[2]))

for i in range(m):
    print(l[i][4])
Buggy code:
import sys
input = sys.stdin.readline
N, M = map(int,input().split())
P = []
for i in range(M) :
    p, y = map(int,input().split())
    P.append([p, y, i])

P.sort(key = lambda x: (x[0],x[1]))
print(P)

ans = [0 for i in range(M)]
count = 1

for i in range(M) :
    num = P[i][2]
    if i > 0 :
        if P[i][0] == P[i-1][0] :
            count += 1
        else :
            count = 1
    ans[num] = str(P[i][0]).zfill(6) + str(count).zfill(6)

for t in ans :
    print(t)


Fixed code:
import sys
input = sys.stdin.readline
N, M = map(int,input().split())
P = []
for i in range(M) :
    p, y = map(int,input().split())
    P.append([p, y, i])

P.sort(key = lambda x: (x[0],x[1]))

ans = [0 for i in range(M)]
count = 1

for i in range(M) :
    num = P[i][2]
    if i > 0 :
        if P[i][0] == P[i-1][0] :
            count += 1
        else :
            count = 1
    ans[num] = str(P[i][0]).zfill(6) + str(count).zfill(6)

for t in ans :
    print(t)
Buggy code:
import sys
input = sys.stdin.readline

N_ken,M_si = map(int,input().split())
ken_year_map = {}
for i in range(1,N_ken+1):ken_year_map[i]=[]

ken_list = [0]*M_si
year_list = [0]*M_si

for si in range(M_si):
    ken_list[si],year_list[si] = map(int,input().split())
    ken_year_map[ken_list[si]] += [year_list[si]]
        
for i in ken_year_map:
    ken_year_map[i].sort()

for ken,year in zip(ken_list,year_list):
    print('{:06}{:06}'.format(ken,bisect.bisect_right(d[ken], year)))


Fixed code:
import sys
input = sys.stdin.readline
import bisect

N_ken,M_si = map(int,input().split())
ken_year_map = {}
for i in range(1,N_ken+1):ken_year_map[i]=[]

ken_list = [0]*M_si
year_list = [0]*M_si

for si in range(M_si):
    ken_list[si],year_list[si] = map(int,input().split())
    ken_year_map[ken_list[si]] += [year_list[si]]
        
for i in ken_year_map:
    ken_year_map[i].sort()

for ken,year in zip(ken_list,year_list):
    print('{:06}{:06}'.format(ken,bisect.bisect_right(ken_year_map[ken], year)))
Buggy code:
n,m=map(int,input().split())
l=[]
for i in range(n):l.append([])
for i in range(m):
    print(i)
    p,y=map(int,input().split())
    l[p-1].append((i,y))
rl=[]
for i in range(n):
    ll=l[i]
    ll.sort(key=lambda x:x[1])
    hd="000000"+str(i+1)[-6:]
    rr=[(ll[j][0],hd+("000000"+str(j+1))[-6:]) for j in range(len(ll))]
    rl+=rr
rl.sort()
for e in rl:
    print(e[1])


Fixed code:
n,m=map(int,input().split())
l=[]
for i in range(n):l.append([])
for i in range(m):
    p,y=map(int,input().split())
    l[p-1].append((i,y))
rl=[]
for i in range(n):
    ll=l[i]
    ll.sort(key=lambda x:x[1])
    hd=("000000"+str(i+1))[-6:]
    rr=[(ll[j][0],hd+("000000"+str(j+1))[-6:]) for j in range(len(ll))]
    rl+=rr
rl.sort()
for e in rl:
    print(e[1])
Buggy code:
n,m = map(int,input().split())
l = [[] for i in range(m)]
for i in range(m):
    a,b = map(int,input().split())
    l[i] = [a,b,i]
l = list(sorted(l,key=lambda x: x[0]))
ans = [[] for i in range(m)]
x = 0
y = 1
for i in range(m):
    if x != l[i][0]:
        x = l[i][0]
        y = 1
    else:
        y += 1
    a = str(x).zfill(6)
    b = str(y).zfill(6)
    ans[i] = [a+b,l[i][2]]
ans = list(sorted(ans,key=lambda x: x[1]))
for i in range(m):
    print(ans[i][0])

Fixed code:
n,m = map(int,input().split())
l = [[] for i in range(m)]
for i in range(m):
    a,b = map(int,input().split())
    l[i] = [a,b,i]
l = list(sorted(l,key=lambda x: (x[0], x[1])))
ans = [[] for i in range(m)]
x = 0
y = 1
for i in range(m):
    if x != l[i][0]:
        x = l[i][0]
        y = 1
    else:
        y += 1
    a = str(x).zfill(6)
    b = str(y).zfill(6)
    ans[i] = [a+b,l[i][2]]
ans = list(sorted(ans,key=lambda x: x[1]))
for i in range(m):
    print(ans[i][0])
Buggy code:
N,M = map(int,input().split())
d=[0]*M
res = []
for i in range(M):
    P,Y = map(int,input().split())
    res.append((P,Y,i))
c=1
print(res)
for i in sorted(res):
    x = str(i[0])
    y = str(i[1])
    tmp = (6-len(x))*'0'+x+(6-len(str(c)))*'0'+str(c)
    if(tmp in d):
        c+=1
        d[i[2]] = (6-len(x))*'0'+x+(6-len(str(c)))*'0'+str(c)
    else:
        c = 1
        d[i[2]] = (6-len(x))*'0'+x+(6-len(str(c)))*'0'+str(c)

for i in d:
    print(i)

Fixed code:
N,M = map(int,input().split())
d=[0]*M
res = []
for i in range(M):
    P,Y = map(int,input().split())
    res.append((P,Y,i))
c=0
res.sort()
t = str(res[0][0])
for i in res:
    x = str(i[0])
    tmp = (6-len(x))*'0'+x+(6-len(str(c)))*'0'+str(c)
    if x == t:
        c+=1
    else:
        c=1
        t = x
    d[i[2]] = (6-len(x))*'0'+x+(6-len(str(c)))*'0'+str(c)

for i in d:
    print(i)
Buggy code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter

N,M = [int(x) for x in stdin.readline().rstrip().split()]
counter = 0
country = 1

ID = []

for i in range(M):
    p,y = [int(x) for x in stdin.readline().rstrip().split()]
    ID.append([p,y,i,"no"])
ID.sort(key=itemgetter(0,1))

for i in range(M):
    if ID[i][0] != country:
        counter = 0
    country = ID[i][0]
    counter += 1
    ID_m = format(ID[i][0],"04") + format(counter,"04")
    ID[i][3] = ID_m
    
ID.sort(key=itemgetter(2))

for i in range(M):
    print(ID[i][3])

Fixed code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter

N,M = [int(x) for x in stdin.readline().rstrip().split()]
counter = 0
country = 1

ID = []

for i in range(M):
    p,y = [int(x) for x in stdin.readline().rstrip().split()]
    ID.append([p,y,i,"no"])
ID.sort(key=itemgetter(0,1))

for i in range(M):
    if ID[i][0] != country:
        counter = 0
    country = ID[i][0]
    counter += 1
    ID_m = format(ID[i][0],"06") + format(counter,"06")
    ID[i][3] = ID_m
    
ID.sort(key=itemgetter(2))

for i in range(M):
    print(ID[i][3])