#include <bits/stdc++.h>
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<int> ans(n, 0);
  int dig;
  int val;
  for (int i = 0; i < m; i++) {
    std::cin >> dig >> val;
    ans[dig - 1] = val;
  }
  for (int i = 0; i < n; i++) {
    std::cout << ans[i];
  }
  std::cout << "\n";
  return 0;
}
