#include <bits/stdc++.h>
using namespace std;
int val[4];
int main() {
  memset(val, -1, sizeof val);
  int n, m;
  cin >> n >> m;
  int ada = 1;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    if (val[u] != -1 && val[u] != v)
      ada = 0;
    else
      val[u] = v;
  }
  if (val[1] == 0 && n > 1) ada = 0;
  for (int i = 1; i <= n; i++) {
    if (val[i] == -1) {
      if (i == 1)
        cout << 1;
      else
        cout << 0;
    } else
      cout << val[i];
  }
  cout << endl;
}
