#include <iostream>
using namespace std;
int main(void)
{
int N, M;
int* arr = NULL;
int i, j, k;
int t, s;
cin >> N >> M;
if ((N >= 1 && N <= 100) && (M >= 1 && M <= 100))
{
arr = new int[N] {};
for (t = 0; t < M; t++)
{
cin >> i >> j >> k;
if((i >= 1 && i <= j)&&(j >= 1 && j<= N)&&(k >= 1 && k <= N))
{
for (s = i-1; s < j; s++)
{
arr[s] = k;
}
}
else
{
t--;
}
}
for (s = 0; s < N; s++)
{
cout << arr[s] << " ";
}
cout << endl;
}
else
{
;
}
delete[] arr;
return 0;
}