#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, i, count, s, c;
  count = 1;
  cin >> N >> M;
  int number[N];
  for (i = 0; i < N; i++) {
    number[i] = 0;
  }
  for (i = 0; i < M; i++) {
    s = 0;
    c = 0;
    cin >> s >> c;
    if (number[s - 1] != 0) {
      count = 0;
    }
    number[s - 1] = c;
  }
  if (number[0] != 0) {
    for (i = 0; i < N; i++) {
      cout << number[i];
    }
  }
  if ((number[0] == 0) && (number[1] != 0)) {
    for (i = 1; i < N; i++) {
      cout << number[i];
    }
  }
  if ((number[0] == 0) && (number[1] == 0)) {
    for (i = 2; i < N; i++) {
      cout << number[i];
    }
  }
  return 0;
}
