#include <bits/stdc++.h>
using namespace std;
void HIK_FILEOPEN(string fileTxt) {
  string inp = fileTxt + ".in", outp = fileTxt + ".out";
  freopen(inp.c_str(), "r", stdin);
  freopen(outp.c_str(), "w", stdout);
}
long long int HIK_POW(long long int x, long long int pow) {
  long long int res = 1;
  for (long long int i = 0; i < pow; i++) res *= x;
  return res;
}
long long int HIK_MOD(long long int number, long long int module) {
  if (number < 0) return HIK_MOD(number + module, module);
  return number % module;
}
long long int n, m;
long long int dp[200] = {};
typedef struct {
  long long int index;
  long long int si;
  long long int di;
  long long int ci;
} exam;
bool c(exam a, exam b) {
  if (a.di < b.di) {
    return true;
  }
  return false;
}
int main() {
  cin >> n >> m;
  vector<exam> e;
  for (long long int i = 0; i < m; i++) {
    exam x;
    x.index = i;
    cin >> x.si >> x.di >> x.ci;
    e.push_back(x);
  }
  sort(e.begin(), e.end(), c);
  for (long long int i = 0; i < m; i++) {
    exam x = e[i];
    long long int s = x.si;
    long long int d = x.di;
    long long int c = x.ci;
    long long int f = 0;
    for (long long int t = 0; f < c; t++) {
      if (t + s > n) {
        cout << -1;
        return 0;
      }
      if (dp[t + s] != 0) {
        continue;
      }
      if (t + s == d) {
        cout << -1;
        return 0;
      }
      f++;
      dp[t + s] = x.index + 1;
    }
    if (f != c) {
      cout << -1;
      return 0;
    }
    dp[d] = m + 1;
  }
  for (long long int i = 1; i < n + 1; i++) {
    cout << dp[i] << " ";
  }
  return 0;
}
