#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[5];
  memset(a, '0', sizeof(a));
  int i;
  int s, c;
  int n, m, flag = 0;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> s >> c;
    a[s - 1] = c + '0';
  }
  for (i = 0; i < n; i++) {
    if (a[i] == '0' && flag == 0) continue;
    if (a[i] != '0' && flag == 0) {
      cout << a[i];
      flag = 1;
      continue;
    }
    cout << a[i];
  }
  cout << endl;
}
