const inputs = require("fs").readFileSync(0, "utf8").toString().split("\n");
const [n, m] = inputs[0].split(" ").map(Number);
let arr = new Array(n).fill(0);

for (let l=1; l<=m; l++) {
    let [i, j, k] = inputs[l].split(" ").map(Number);
    for (let t=i-1; t<j; t++) arr[t] = k;
}

console.log(...arr);
