Brief Statements Union

아직 제출이 없습니다시간 제한10초메모리 제한512 MB

문제

Egor learned about the secret organization called Brief Statements Union (BSU), whose ultimate goal is to make statements of all competitive programming problems clear and concise, and eliminate those long, boring, and unnecessary tales in the statements.

Egor decided to join the organization. For this purpose, he wrote the following problem with a short statement:

You are given an integer nn and kk conditions. The ii-th condition states that bitwise AND of all integers a_l_i,a_l_i+1,,a_r_ia\_{l\_i}, a\_{l\_i + 1}, \ldots, a\_{r\_i} is equal to x_ix\_i.

For each condition ii, determine if there exists an array a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n of nn integers which satisfies all the conditions except the condition ii. Note that it is OK if the array satisfies the condition ii too.

The committee of the organization liked Egor's problem statement. And this is how he got accepted into the organization. Now, Egor has decided to offer the problem to this contest, so you have to solve it.

입력

The first line contains two integers nn and kk, denoting the required length of the array and the number of the conditions (1n,k1061 \le n, k \le 10^6).

Then kk lines follow, the ii-th of them contains three integers l_il\_i, r_ir\_i, x_ix\_i, describing the ii-th condition (1l_ir_in1 \le l\_i \le r\_i \le n, 0x_i10180 \le x\_i \le 10^{18}).

출력

Print the binary string of kk characters. The ii-th character must be equal to '1' if there is an array of length nn which satisfies all the conditions with the ii-th one being removed. Otherwise, the ii-th character must be equal to '0'.