#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n, m;
vector<vector<int> > g;
int color[300005];
queue<pair<int, int> > Q;
void solve() {
  memset(color, -1, sizeof(color));
  for (int i = 0; i < n; i++) {
    if (color[i] == -1) {
      Q = queue<pair<int, int> >();
      Q.push(make_pair(i, 0));
      color[i] = 0;
      while (!Q.empty()) {
        int u = Q.front().first, c = !Q.front().second;
        Q.pop();
        for (size_t i = 0; i < g[u].size(); i++) {
          int v = g[u][i];
          if (color[v] == -1) {
            color[v] = c;
            Q.push(make_pair(v, c));
          }
        }
      }
    }
  }
  bool good = false;
  int cnt = 0;
  while (!good && cnt < 100) {
    good = true;
    for (int i = 0; i < n; i++) {
      int cnt = 0;
      for (size_t j = 0; j < g[i].size(); j++) {
        if (color[g[i][j]] == color[i]) {
          cnt++;
        }
      }
      if (cnt > 1) {
        color[i] = !color[i];
        good = false;
      }
    }
    cnt++;
  }
  if (!good) {
    printf("-1\n");
  } else {
    for (int i = 0; i < n; i++) {
      printf("%d", color[i]);
    }
    printf("\n");
  }
}
int main() {
  while (cin >> n >> m) {
    g = vector<vector<int> >(n);
    for (int i = 0; i < m; i++) {
      int a, b;
      scanf("%d %d", &a, &b);
      a--;
      b--;
      g[a].push_back(b);
      g[b].push_back(a);
    }
    solve();
  }
}
