#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  for (int i = 0; i < n; i++) a[i] = -1;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) cout << a[n - j - 1] << " ";
    cout << endl;
    int s, c;
    cin >> s;
    cin >> c;
    if (a[n - s] == -1 || a[n - s] == c)
      a[n - s] = c;
    else {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[n - i - 1] == 0 && a[n - i] == -1 && i > 0) {
      cout << -1 << endl;
      return 0;
    } else if (a[n - i - 1] == 0 && i == 0) {
      cout << -1 << endl;
      return 0;
    }
    if (a[n - i - 1] != -1)
      cout << a[n - i - 1];
    else if (i > 0 && a[n - i] != -1)
      cout << 0;
  }
  cout << endl;
  return 0;
}
