Buggy python submission (verdict: Runtime Error):
def main():

    N, M = map(int, input().split())
    if N == 1:
        s, c = map(int, input().split())
        if s == 1: return c
        else: return -1

    if M == 0:
        return pow(10, N-1)

    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    for v in range(pow(10, N-1), pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())

Fixed submission:
def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    start = pow(10, N-1)
    if N == 1: start = 0
    
    for v in range(start, pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Runtime Error):
def main():
 
    N, M = map(int, input().split())
    if N == 1:
        s, c = map(int, input().split())
        if s == 1: return c
        else: return -1
    
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])
 
    for v in range(pow(10, N-1), pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1
 
if __name__ == '__main__':
    print(main())

Fixed submission:
def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    start = pow(10, N-1)
    if N == 1: start = 0
    
    for v in range(start, pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Runtime Error):
def main():
 
    N, M = map(int, input().split())
    if N == 1:
      s, c = map(int, input().split())
      return c
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])
    #if N == 1:
    #    return sc[0][1]
 
    for v in range(pow(10, N-1), pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1
 
if __name__ == '__main__':
    print(main())

Fixed submission:
def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    start = pow(10, N-1)
    if N == 1: start = 0
    
    for v in range(start, pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Runtime Error):
def main():
 
    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])
    if N == 1:
        return sc[0][1]
 
    for v in range(pow(10, N-1), pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1
 
if __name__ == '__main__':
    print(main())

Fixed submission:
def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    start = pow(10, N-1)
    if N == 1: start = 0
    
    for v in range(start, pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Runtime Error):
def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])
    if N == 1:
        return sc[0][1]

    for v in range(pow(10, N-1), pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())


Fixed submission:
def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    start = pow(10, N-1)
    if N == 1: start = 0
    
    for v in range(start, pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())

Buggy python submission (verdict: Runtime Error):
def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])
    if N == 1:
        return c

    for v in range(pow(10, N-1), pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())


Fixed submission:
def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    start = pow(10, N-1)
    if N == 1: start = 0
    
    for v in range(start, pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())