n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]

seen = []
list_1 = [ x  for x in sc if x  not in seen and not seen.append(x)]

flag = [0]*n
ans = [0]*n

for i in range(len(list_1)):
    ans[list_1[i][0] - 1] = list_1[i][1]
    flag[list_1[i][0] - 1] += 1
