#D4039. Lookup Tables

    ID: 3351 Type: Default 1000ms 256MiB

Lookup Tables

Lookup Tables

John has Q closed intervals of consecutive 2K-bit numbers [l_i, r_i] and one 16-bit value v_i for each interval. (0 ≤ i < Q)

John wants to implement a function F that maps 2K-bit numbers to 16-bit numbers in such a way that inputs from each interval are mapped to that interval's value. In other words: $$$F(x) = v_i, \; for every 0 ≤ i < Q \; , and every x ∈ [l_i, r_i]$$$ The output of F for other inputs is unimportant.

John wants to make his implementation of F fast so he has decided to use lookup tables. A single 2K-bit lookup table would be too large to fit in memory, so instead John plans to use two K-bit lookup tables, LSBTable and MSBTable. His implementation will look like this: $$$ F(x) = LSBTable[lowKBits(x)] \; \& \; MSBTable[highKBits(x)]$$$ In other words it returns the "bitwise and" of results of looking up the K least significant bits in LSBTable and the K most significant bits in MSBTable.

John needs your help. Given K, Q and Q intervals [l_i, r_i] and values v_i, find any two lookup tables which can implement F or report that such tables don't exist.

Input

The first line contains two integers K and Q ( 1 <= K <= 16, 1 <= Q <= 2⋅ 10^5).

Each of the next Q lines contains three integers l_i, r_i and v_i. ( 0 ≤ l_i ≤ r_i < 2^{2K}, 0 ≤ v_i < 2^{16}).

Output

On the first line output "possible" (without quotes) if two tables satisfying the conditions exist, or "impossible" (without quotes) if they don't exist.

If a solution exists, in the next 2 ⋅ 2^K lines your program should output all values of the two lookup tables (LSBTable and MSBTable) it found. When there are multiple pairs of tables satisfying the conditions, your program may output any such pair.

On lines 1 + i output LSBTable[i]. (0 ≤ i < 2^K, 0 ≤ LSBTable[i] < 2^{16}).

On lines 1 + 2^K + i output MSBTable[i]. (0 ≤ i < 2^K, 0 ≤ MSBTable[i] < 2^{16}).

Examples

Input

1 2 0 2 1 3 3 3

Output

possible 1 3 1 3

Input

2 4 4 5 3 6 7 2 0 3 0 12 13 1

Output

possible 3 3 2 2 0 3 0 1

Input

2 3 4 4 3 5 6 2 12 14 1

Output

impossible

Note

A closed interval [a, b] includes both a and b.

In the first sample, tables LSBTable = [1,3] and MSBTable = [1,3] satisfy the conditions: F[0] = LSBTable[0] & MSBTable[0] = 1 & 1 = 1, F[1] = LSBTable[1] & MSBTable[0] = 3 & 1 = 1, F[2] = LSBTable[0] & MSBTable[1] = 1 & 3 = 1, F[3] = LSBTable[1] & MSBTable[1] = 3 & 3 = 3.

In the second sample, tables LSBTable = [3,3,2,2] and MSBTable = [0,3,0,1] satisfy all the conditions.

In the third sample there are no two lookup tables which can satisfy the conditions.

inputFormat

inputs from each interval are mapped to that interval's value. In other words: $$$F(x) = v_i, \; for every 0 ≤ i < Q \; , and every x ∈ [l_i, r_i]$$$ The

outputFormat

output of F for other inputs is unimportant.

John wants to make his implementation of F fast so he has decided to use lookup tables. A single 2K-bit lookup table would be too large to fit in memory, so instead John plans to use two K-bit lookup tables, LSBTable and MSBTable. His implementation will look like this: $$$ F(x) = LSBTable[lowKBits(x)] \; \& \; MSBTable[highKBits(x)]$$$ In other words it returns the "bitwise and" of results of looking up the K least significant bits in LSBTable and the K most significant bits in MSBTable.

John needs your help. Given K, Q and Q intervals [l_i, r_i] and values v_i, find any two lookup tables which can implement F or report that such tables don't exist.

Input

The first line contains two integers K and Q ( 1 <= K <= 16, 1 <= Q <= 2⋅ 10^5).

Each of the next Q lines contains three integers l_i, r_i and v_i. ( 0 ≤ l_i ≤ r_i < 2^{2K}, 0 ≤ v_i < 2^{16}).

Output

On the first line output "possible" (without quotes) if two tables satisfying the conditions exist, or "impossible" (without quotes) if they don't exist.

If a solution exists, in the next 2 ⋅ 2^K lines your program should output all values of the two lookup tables (LSBTable and MSBTable) it found. When there are multiple pairs of tables satisfying the conditions, your program may output any such pair.

On lines 1 + i output LSBTable[i]. (0 ≤ i < 2^K, 0 ≤ LSBTable[i] < 2^{16}).

On lines 1 + 2^K + i output MSBTable[i]. (0 ≤ i < 2^K, 0 ≤ MSBTable[i] < 2^{16}).

Examples

Input

1 2 0 2 1 3 3 3

Output

possible 1 3 1 3

Input

2 4 4 5 3 6 7 2 0 3 0 12 13 1

Output

possible 3 3 2 2 0 3 0 1

Input

2 3 4 4 3 5 6 2 12 14 1

Output

impossible

Note

A closed interval [a, b] includes both a and b.

In the first sample, tables LSBTable = [1,3] and MSBTable = [1,3] satisfy the conditions: F[0] = LSBTable[0] & MSBTable[0] = 1 & 1 = 1, F[1] = LSBTable[1] & MSBTable[0] = 3 & 1 = 1, F[2] = LSBTable[0] & MSBTable[1] = 1 & 3 = 1, F[3] = LSBTable[1] & MSBTable[1] = 3 & 3 = 3.

In the second sample, tables LSBTable = [3,3,2,2] and MSBTable = [0,3,0,1] satisfy all the conditions.

In the third sample there are no two lookup tables which can satisfy the conditions.

样例

1 2
0 2 1
3 3 3
possible

1 3 1 3

</p>