#include <bits/stdc++.h>
using namespace std;
int n, m, a[10];
int s, c;
int main() {
  cin >> n >> m;
  int p = m;
  while (m--) {
    cin >> s >> c;
    a[s] = c;
  }
  if (a[1] == 0) a[1] = 1;
  for (int i = 1; i <= p; i++) cout << a[i];
  cout << endl;
  return 0;
}
