import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String[] STR = br.readLine().split(" ");
int N = Integer.parseInt(STR[0]);
int M = Integer.parseInt(STR[1]);
int[] intArray = new int[N];
for(int j = 0 ; j < N ; j++){
intArray[j] = 0;
}
for(int i = 0 ; i < M ; i++){
String[] STR2 = br.readLine().split(" ");
int a = Integer.parseInt( STR2[0] );
int b = Integer.parseInt( STR2[1] );
int c = Integer.parseInt( STR2[2] );
for(int k = a ; k <= b ; k++){
intArray[k-1] = c;
}
}
for(int j = 0; j < N ; j++){
bw.write(String.valueOf(intArray[j]) + " ");
}
bw.flush();
bw.close();
}
}