GCD#10491

GCD

1 second
256 megabytes
Easy

Find an array consisting of positive integers (also known as natural numbers) that meets specified constraints:

\gcd(a_{l_i}, a_{l_i+1}, \dots, a_{r_i})=x_i

Here, denotes the greatest common divisor.

Input

The first line contains two integers, and (1 \leq n, m \leq 150\,000).

Each of the following lines contains three integers: l_i, r_i, and x_i (1 \leq l_i \leq r_i \leq n, 1 \leq x_i \leq 16).

Output

If such an array exists, output integers a_1, a_2, \dots, a_n (1 \leq a_i \leq 10^9).

If no such array can be constructed, output .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Scoring

  1. ( points): n, m \leq 2\,000; x_i \leq 2;

  2. ( points): n, m \leq 2\,000;

  3. ( points): no additional constraints.