Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
t='000'
if n==2: t='010'
if n==3: t='100'
f=[0]*len(t)
t=[int(t[0]),int(t[1]),int(t[2])]
for i in range(m):
    ans = -1
    s,c = map(int,input().split())
    s=s-(n-2)
    if c <  t[s]: break
    if c >  t[s]:
        if f[s]==0:
            f[s],t[s]=1,c
        elif f[s]==1:
            break
    ans=t[0]*100+t[1]*10+t[2]
print(ans)
print(f)

Fixed submission:
n,m = map(int,input().split())
t='000'
if n==2: t='010'
if n==3: t='100'
f=[0]*len(t)
t=[int(t[0]),int(t[1]),int(t[2])]
ans = t[0]*100+t[1]*10+t[2] 
for i in range(m):
    ans = -1
    s,c = map(int,input().split())
    s=s-(n-2)
    if c <  t[s]: break
    if c >  t[s]:
        if f[s]==0:
            f[s],t[s]=1,c
        elif f[s]==1:
            break
    ans=t[0]*100+t[1]*10+t[2]
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
t='000'
if n==2: t='010'
if n==3: t='100'
f=[0]*len(t)
t=[int(t[0]),int(t[1]),int(t[2])]
for i in range(m):
    ans = -1
    s,c = map(int,input().split())
    s=s-(n-2)
    if c <  t[s]: break
    if c >  t[s]:
        if f[s]==0:
            f[s],t[s]=1,c
        elif f[s]==1:
            break
    ans=t[0]*100+t[1]*10+t[2]
print(ans)

Fixed submission:
n,m = map(int,input().split())
t='000'
if n==2: t='010'
if n==3: t='100'
f=[0]*len(t)
t=[int(t[0]),int(t[1]),int(t[2])]
ans = t[0]*100+t[1]*10+t[2] 
for i in range(m):
    ans = -1
    s,c = map(int,input().split())
    s=s-(n-2)
    if c <  t[s]: break
    if c >  t[s]:
        if f[s]==0:
            f[s],t[s]=1,c
        elif f[s]==1:
            break
    ans=t[0]*100+t[1]*10+t[2]
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
t=0
if n==2: t=10
if n==3: t=100
t=str(t)
tt = list()
for i in range(n):
    tt.append(int(t[i]))
f=[0]*len(tt)
for i in range(m):
    ans = -1
    s,c = map(int,input().split())
    s-=1
    if c <  tt[s]: break
    if c >  tt[s]:
        if f[s]==0:
            f[s],tt[s]=1,c
        elif f[s]==1:
            break
    if n==1: ans=tt[0]
    if n==2: ans=tt[0]*10+tt[1]
    if n==3: ans=tt[0]*100+tt[1]*10+tt[2]

print(ans)

Fixed submission:
n,m = map(int,input().split())
t='000'
if n==2: t='010'
if n==3: t='100'
f=[0]*len(t)
t=[int(t[0]),int(t[1]),int(t[2])]
ans = t[0]*100+t[1]*10+t[2] 
for i in range(m):
    ans = -1
    s,c = map(int,input().split())
    s=s-(n-2)
    if c <  t[s]: break
    if c >  t[s]:
        if f[s]==0:
            f[s],t[s]=1,c
        elif f[s]==1:
            break
    ans=t[0]*100+t[1]*10+t[2]
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
t=0
if n==2: t=10
if n==3: t=100
t=str(t)
t=[int(t[0]),int(t[1]),int(t[2])]
f=[0]*len(t)
for i in range(m):
    ans = -1
    s,c = map(int,input().split())
    s-=1
    if c <  t[s]: break
    if c >  t[s]:
        if f[s]==0:
            f[s],t[s]=1,c
        elif f[s]==1:
            break
    ans=t[0]*100+t[1]*10+t[2]
print(ans)

Fixed submission:
n,m = map(int,input().split())
t='000'
if n==2: t='010'
if n==3: t='100'
f=[0]*len(t)
t=[int(t[0]),int(t[1]),int(t[2])]
ans = t[0]*100+t[1]*10+t[2] 
for i in range(m):
    ans = -1
    s,c = map(int,input().split())
    s=s-(n-2)
    if c <  t[s]: break
    if c >  t[s]:
        if f[s]==0:
            f[s],t[s]=1,c
        elif f[s]==1:
            break
    ans=t[0]*100+t[1]*10+t[2]
print(ans)