Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

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

flag = 0
ans = [None for i in range(m)]
# print(ans)
for i in range(m):
    s, c = map(int, input().split())
    if ans[s-1] is None or ans[s-1] == c:
        ans[s-1] = c
    else:
        flag = 1

# print(flag)
if ans[0] == 0:
    flag = 1
if ans[0] is None:
    ans[0] = 1
for i in range(1, len(ans)):
    if ans[i] is None:
        ans[i] = 0

print("".join(map(str, ans)) if flag == 0 else -1)


Fixed submission:
# C
N, M = list(map(int, input().split()))

flag = 0
ans = [0]*N
ans_flag = [0]*N

sc = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    s, c = sc[i]
    if ans_flag[s-1] == 1:
        if ans[s-1] != c:
            flag = 1
            break
    ans_flag[s-1] = 1
    ans[s-1] = c

if flag == 1:
    print("-1")
else:
    if N==1:
        for i in ans:
            print(i, end="")

    elif ans[0] == 0 and ans_flag[0]==1:
        print("-1")
    else:
        if ans[0]==0:
            ans[0] = 1
        for i in ans:
            print(i, end="")

Buggy python submission (verdict: Runtime Error):
# C
N, M = list(map(int, input().split()))

flag = 0
ans = [0]*M
ans_flag = [0]*M

sc = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    s, c = sc[i]
    if ans_flag[s-1] == 1:
        if ans[s-1] != c:
            flag = 1
            break
    ans_flag[s-1] = 1
    ans[s-1] = c

if flag == 1:
    print("-1")
else:
    if ans[0] == 0 and ans_flag[0]==1:
        print("-1")
    else:
        if ans[0]==0:
            ans[0] = 1
        for i in ans:
            print(i, end="")


    


Fixed submission:
# C
N, M = list(map(int, input().split()))

flag = 0
ans = [0]*N
ans_flag = [0]*N

sc = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    s, c = sc[i]
    if ans_flag[s-1] == 1:
        if ans[s-1] != c:
            flag = 1
            break
    ans_flag[s-1] = 1
    ans[s-1] = c

if flag == 1:
    print("-1")
else:
    if N==1:
        for i in ans:
            print(i, end="")

    elif ans[0] == 0 and ans_flag[0]==1:
        print("-1")
    else:
        if ans[0]==0:
            ans[0] = 1
        for i in ans:
            print(i, end="")

Buggy python submission (verdict: Runtime Error):
# C
N, M = list(map(int, input().split()))

flag = 0
ans = [0]*M
ans_flag = [0]*M

sc = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    s, c = sc[i]
    if ans_flag[s-1] == 1:
        if ans[s-1] != c:
            flag = 1
            break
    ans_flag[s-1] = 1
    ans[s-1] = c

if flag == 1:
    print("-1")
else:
    if ans[0] == 0 and ans_flag[0]==1:
        print("-1")
    else:
        if ans[0]==0:
            ans[0] = 1
        print(ans)  

    


Fixed submission:
# C
N, M = list(map(int, input().split()))

flag = 0
ans = [0]*N
ans_flag = [0]*N

sc = [list(map(int, input().split())) for _ in range(M)]
for i in range(M):
    s, c = sc[i]
    if ans_flag[s-1] == 1:
        if ans[s-1] != c:
            flag = 1
            break
    ans_flag[s-1] = 1
    ans[s-1] = c

if flag == 1:
    print("-1")
else:
    if N==1:
        for i in ans:
            print(i, end="")

    elif ans[0] == 0 and ans_flag[0]==1:
        print("-1")
    else:
        if ans[0]==0:
            ans[0] = 1
        for i in ans:
            print(i, end="")