#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> vec(n + 1, 0);
  int a, b;
  for (int i = 0; i < (k); ++i) {
    cin >> a >> b;
    for (int j = (a); j < (b + 1); ++j) {
      vec[j] = 1;
    }
  }
  for (int i = 0; i < (n); ++i) {
    cout << (vec[i]) << "\n";
  }
}
