#include <bits/stdc++.h>
using namespace std;
vector<long long int> vec;
vector<vector<long long int> > vec2;
long long int MOD = 1000000007;
long long int INF = 1145141919454519;
int main() {
  long long int N, M;
  cin >> N >> M;
  vector<long long int> v(N, -1);
  for (long long int i = 0; i < M; i++) {
    long long int s, c;
    cin >> s >> c;
    if (v[s - 1] == -1) {
      v[s - 1] = c;
    } else {
      v[s - 1] = min(v[s - 1], c);
    }
  }
  for (long long int i = 0; i < N; i++) {
    if (i == 0) {
      if (v[i] == -1 || v[i] == 0) {
        cout << -1 << endl;
        return 0;
      } else {
        cout << v[0];
      }
    } else {
      if (v[i] == -1) {
        cout << 0;
      } else {
        cout << v[i];
      }
    }
    cout << endl;
  }
}
