#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> s(M), c(M);
  for (int i = 0; i < M; i++) {
    cin >> s[i] >> c[i];
  }
  vector<int> num(N, 0);
  for (int i = 0; i < M; i++) {
    num[s[i] - 1] = c[i];
  }
  bool notzero = false;
  for (int i = 0; i < N; i++) {
    if (num[i] != 0) notzero = true;
    if (notzero) cout << num[i];
  }
}
