Buggy python submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 for num in nums if num == -1 else num]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Fixed submission:
import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 if num == -1 else num for num in nums]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Buggy python submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split(" "))
nums = [0] * m
for _ in range(m):
    s,c = map(int,input().split(" "))
    if c >= 10 or c < 0:
        print(-1)
        sys.exit(0)
    if s >= n:
        print(-1)
        sys.exit(0)
    if s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != 0 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Fixed submission:
import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 if num == -1 else num for num in nums]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Buggy python submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split(" "))
nums = [0] * m
for _ in range(m):
    s,c = map(int,input().split(" "))
    if s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != 0 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Fixed submission:
import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 if num == -1 else num for num in nums]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Buggy python submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split(" "))
nums = [0] * m
for _ in range(m):
    s,c = map(int,input().split(" "))
    if nums[s-1] != 0 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Fixed submission:
import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 if num == -1 else num for num in nums]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))