#include using namespace std; const int maxn = 1e5 + 42; struct hash_t { const int mod[2] = {1000000007, 1000000009}; int h[2]; hash_t(){} hash_t(int x) { h[0] = x % mod[0]; h[1] = x % mod[1]; } hash_t operator -=(hash_t t) { h[0] = (h[0] + mod[0] - t.h[0]) % mod[0]; h[1] = (h[1] + mod[1] - t.h[1]) % mod[1]; return *this; } hash_t operator +=(hash_t t) { h[0] = (h[0] + t.h[0]) % mod[0]; h[1] = (h[1] + t.h[1]) % mod[1]; return *this; } hash_t operator *=(hash_t t) { h[0] = 1LL * h[0] * t.h[0] % mod[0]; h[1] = 1LL * h[1] * t.h[1] % mod[1]; return *this; } hash_t operator -(hash_t t) { hash_t a(*this); return a -= t; } hash_t operator +(hash_t t) { hash_t a(*this); return a += t; } hash_t operator *(hash_t t) { hash_t a(*this); return a *= t; } hash_t operator=(hash_t t) { h[0] = t.h[0]; h[1] = t.h[1]; return *this; } hash_t operator%(hash_t t) { return *this; } bool operator==(hash_t t) { return h[0] == t.h[0] && h[1] == t.h[1]; } bool operator!=(hash_t t) { return !(*this == t); } } base = 1337, precalc[maxn]; hash_t segment(int l, int r) { return precalc[r] - precalc[l]; } const int logn = 18, maxs = 15 * maxn * logn; hash_t subs[maxs]; int L[maxs], R[maxs], p[maxs], root[maxs]; int rt = 1, sz = 1; int copy(int &u, int v) { L[sz] = L[v]; R[sz] = R[v]; p[sz] = p[v]; subs[sz] = subs[v]; return u = sz++; } int make_root() { copy(root[rt], root[rt - 1]); return root[rt++]; } void push(int v, int l, int r) { if(p[v]) { subs[v] = segment(l, r) - subs[v]; if(r - l > 1) { p[copy(L[v], L[v])] ^= 1; p[copy(R[v], R[v])] ^= 1; } p[v] = 0; } } void inv(int a, int b, int v = make_root(), int l = 0, int r = maxn) { push(v, l, r); if(a <= l && r <= b) { p[v] = 1; push(v, l, r); return; } if(r <= a || b <= l) return; int m = (l + r) / 2; inv(a, b, copy(L[v], L[v]), l, m); inv(a, b, copy(R[v], R[v]), m, r); subs[v] = subs[L[v]] + subs[R[v]]; } hash_t get(int p, int v, int l = 0, int r = maxn) { push(v, l, r); if(r - l == 1) return 0; int m = (l + r) / 2; if(p < m) { return get(p, L[v], l, m); } else { push(L[v], l, m); return subs[L[v]] + get(p, R[v], m, r); } } bool cmp(int a, int b) { a = root[a]; b = root[b]; int l = 0, r = maxn; while(r - l > 1) { int m = (l + r) / 2; if(get(m, a) == get(m, b)) l = m; else r = m; } return (get(l + 1, a) - get(l, a) != 0) < (get(l + 1, b) - get(l, b) != 0); } main() { //freopen("input.txt", "r", stdin); ios::sync_with_stdio(0); cin.tie(0); precalc[1] = 1; for(int i = 2; i < maxn; i++) precalc[i] = precalc[i - 1] * base + (hash_t)1; int n, u; cin >> n >> u; int cur = 0; for(int i = 1; i <= u; i++) { int l, r; cin >> l >> r; inv(l - 1, r); if(cmp(cur, i)) cur = i; } for(int i = 0; i < n; i++) cout << (get(i + 1, root[cur]) - get(i, root[cur]) != 0); cout << endl; }