N , M = input().split()
M = int(M)
N = int(N)
ans = ['0' for i in range (N)]

for i in range (M) :
    s , c = input().split()
    s = int(s) - 1
    ans[s] = c

res = ''

if (ans[0] == '0') :
    ans[0] = '1'
    
for i in ans :
    res += i

print (res)
