#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  string s = "";
  for (int i = 0; i < n; i++) {
    s += "0";
  }
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    s[a - 1] = b + '0';
  }
  cout << stoi(s) << endl;
}
