n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(list(map(int, input().split())))
print(a)
ans=[0]*n
for i in range(m):
    e=a[i][0]-1
    f=a[i][1]
    ans[e]=f
for i in ans:
    print(i,end="")
