/**
 * Author: Sergey Kopeliovich (Burunduk30@gmail.com)
 */

#include <cstdio>
#include <cassert>
#include <vector>
#include "optimization.h"

using namespace std;

#define forn(i, n) for (int i = 0; i < (int)(n); i++)

const int N = 3e5;

int n, m, a[N], b[N], u[N];
vector<int> c[N];

int dfs( int v, int color ) {
  if (u[v])
    return (u[v] == color);
  u[v] = color;
  for (int x : c[v])
    if (!dfs(x, 3 - color))
      return 0;
  return 1;
}

int solve( int x ) {
  forn(i, n)
    c[i].clear(), u[i] = 0;
  forn(i, x) {
    c[a[i]].push_back(b[i]);
    c[b[i]].push_back(a[i]);
  }
  forn(i, n)
    if (!u[i] && !dfs(i, 1))
      return 0;
  return 1;
}

int main() {
  n = readInt();
  m = readInt();
  forn(i, m) {
    a[i] = readInt() - 1;
    b[i] = readInt() - 1;
  }

  int l = 0, r = m, x;
  while (l < r)
    if (solve(x = (l + r + 1) / 2))
      l = x;
    else
      r = x - 1;
  forn(i, m)
    putchar(i < l ? '1' : '0');
  puts("");
}
