n, m = map(int, input().split()) diff = [0] * (n + 2) # Using indices 1 to n+1 for _ in range(m): l, r = map(int, input().split()) li = l ri = r # The participant contributes from ri to li days ago inclusive diff[ri] += 1 if li + 1 <= n: diff[li + 1] -= 1 # Compute prefix sum to get the number of participants for each day current = 0 ans = [0] * (n + 1) # ans[1], ans[2], ..., ans[n] for day in range(1, n + 1): current += diff[day] ans[day] = current # Output from N days ago (day n) to yesterday (day 1) for day in range(n, 0, -1): print(ans[day])