Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
sc = [tuple(map(int,input().split())) for i in range(m)]
l = [0]*n
for t in sc:
    l[t[0]-1] = t[1]
if sc[0][0]!=1 and sc[0][1]==0:
    l[0]=1
    print("".join([str(s) for s in l]))
elif l[0]==0:
    print(-1)
else:
    print("".join([str(s) for s in l]))

Fixed submission:
n,m = map(int,input().split())
x = [tuple(map(int,input().split())) for i in range(m)]
f=True
for i in range(0,1001):
    i = str(i)
    if len(i)==n:
        if all([i[t[0]-1]==str(t[1]) for t in x]):
            print(i)
            f=False
            break
if f:
    print(-1)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
sc = [tuple(map(int,input().split())) for i in range(m)]
l = [0]*n
for t in sc:
    l[t[0]-1] = t[1]
if sc[0][0]!=1 and sc[0][1]==0:
    l[0]=1
    print("".join([str(s) for s in l]))
else:
    if l[0]==0:
        print(-1)

Fixed submission:
n,m = map(int,input().split())
x = [tuple(map(int,input().split())) for i in range(m)]
f=True
for i in range(0,1001):
    i = str(i)
    if len(i)==n:
        if all([i[t[0]-1]==str(t[1]) for t in x]):
            print(i)
            f=False
            break
if f:
    print(-1)

Buggy python submission (verdict: Runtime Error):
a = -1
n,m = map(int, input().split())
s_and_c = [tuple(map(int,input().split())) for i in range(m)]
s = []
c = []
l = [0]*m
for t in s_and_c:
  l[t[0]-1] = t[1]
for _ in s_and_c:
  s.append(_[0])
  c.append(_[1])
if max(s) == n and l[0] == len(l)-1 or l[0] != 0:
  a = "".join([str(i) for i in l])
else:
  pass
print(a)

Fixed submission:
n,m = map(int,input().split())
x = [tuple(map(int,input().split())) for i in range(m)]
f=True
for i in range(0,1001):
    i = str(i)
    if len(i)==n:
        if all([i[t[0]-1]==str(t[1]) for t in x]):
            print(i)
            f=False
            break
if f:
    print(-1)

Buggy python submission (verdict: Runtime Error):
a = -1
n,m = map(int, input().split())
s_and_c = [tuple(map(int,input().split())) for i in range(m)]
s = []
c = []
l = [0]*m
for t in s_and_c:
  l[t[0]-1] = t[1]
for _ in s_and_c:
  s.append(_[0])
  c.append(_[1])
if max(s) == n and l[0] != 0:
  a = "".join([str(i) for i in l])
else:
  pass
print(a)

Fixed submission:
n,m = map(int,input().split())
x = [tuple(map(int,input().split())) for i in range(m)]
f=True
for i in range(0,1001):
    i = str(i)
    if len(i)==n:
        if all([i[t[0]-1]==str(t[1]) for t in x]):
            print(i)
            f=False
            break
if f:
    print(-1)

Buggy python submission (verdict: Runtime Error):
a = -1
n,m = map(int, input().split())
s_and_c = [tuple(map(int,input().split())) for i in range(m)]
s = []
c = []
l = [0]*m
for t in s_and_c:
  l[t[0]-1] = t[1]
for _ in s_and_c:
  s.append(_[0])
  c.append(_[1])
if max(s) == n:
  a = "".join([str(i) for i in l])
else:
  pass
print(a)

Fixed submission:
n,m = map(int,input().split())
x = [tuple(map(int,input().split())) for i in range(m)]
f=True
for i in range(0,1001):
    i = str(i)
    if len(i)==n:
        if all([i[t[0]-1]==str(t[1]) for t in x]):
            print(i)
            f=False
            break
if f:
    print(-1)

Buggy python submission (verdict: Runtime Error):
a = -1
n,m = map(int, input().split())
s_and_c = [tuple(map(int,input().split())) for i in range(m)]
l = [0]*m
for t in s_and_c:
  l[t[0]-1] = t[1]
if len(l) == n:
  a = "".join([str(i) for i in l])
else:
  pass
print(a)

Fixed submission:
n,m = map(int,input().split())
x = [tuple(map(int,input().split())) for i in range(m)]
f=True
for i in range(0,1001):
    i = str(i)
    if len(i)==n:
        if all([i[t[0]-1]==str(t[1]) for t in x]):
            print(i)
            f=False
            break
if f:
    print(-1)