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

print('s={0},c={1}'.format(s,c))

ans = []
for p in range(N):
    ans.append(-1)
for j in range(M):
    ans[s[j]-1:s[j]] = [c[j]]
for k in range(len(ans)):
    if ans[k]==-1:
        ans[k] = 0
if ans[0] == 0:
    ans[0] = 1
print("".join(map(str,ans)))