#include <bits/stdc++.h>
using namespace std;
struct st {
  int pday, eday, prep;
} exam[110];
int main() {
  int i, j, n, m, day, id, mn;
  vector<int> ans;
  bool flag, ee;
  cin >> n >> m;
  for (i = 0; i < m; i++)
    scanf("%d %d %d", &exam[i].pday, &exam[i].eday, &exam[i].prep);
  day = 1;
  flag = true;
  for (day = 1; day <= n; day++) {
    mn = 10000;
    id = -1;
    ee = false;
    for (j = 0; j < m; j++) {
      if (exam[j].eday == day) {
        if (exam[j].prep == 0) {
          ans.push_back(m + 1);
          ee = true;
        } else
          flag = false;
        break;
      } else if (exam[j].pday <= day && day < exam[j].eday &&
                 exam[j].prep > 0) {
        if (mn > exam[j].eday) mn = exam[j].eday, id = j;
      }
    }
    if (ee == false) {
      exam[id].prep--;
      ans.push_back(id + 1);
    }
  }
  if (flag == false)
    printf("-1\n");
  else
    for (i = 0; i < n; i++) printf("%d ", ans[i]);
  return 0;
}
