#include <bits/stdc++.h>
using namespace std;
using ll = long long;
inline ll read() {
  ll x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const ll maxn = 1 << 16 | 10, maxm = 2e5 + 10;
ll K, q, n;
struct Node {
  ll l, r, v;
} a[maxm];
ll A[maxn], B[maxn], cal[maxn], cha[maxn], pre[maxn], sum[maxn];
inline void Ins(ll *cha, ll l, ll r) {
  cha[l]++;
  cha[r + 1]--;
}
inline ll query(ll *pre, ll l, ll r) {
  ll res = pre[r];
  if (l) res -= pre[l - 1];
  return res;
}
inline bool work(ll Bit) {
  for (ll i = 0; i <= n; ++i) cal[i] = cha[i] = pre[i] = sum[i] = 0;
  for (ll i = 1; i <= q; ++i) {
    ll l = a[i].l >> K, r = a[i].r >> K, L = a[i].l & ((1 << K) - 1),
       R = a[i].r & ((1 << K) - 1);
    if (a[i].v >> Bit & 1) {
      Ins(cal, l, r);
      if (l == r)
        Ins(cha, L, R);
      else {
        if (l + 1 < r)
          Ins(cha, 0, n - 1);
        else {
          Ins(cha, L, n - 1);
          Ins(cha, 0, R);
        }
      }
    }
  }
  pre[0] += cal[0] != 0;
  sum[0] += cha[0] != 0;
  for (ll i = 1; i < n; ++i) {
    cal[i] += cal[i - 1];
    cha[i] += cha[i - 1];
    pre[i] = pre[i - 1];
    sum[i] = sum[i - 1];
    pre[i] += cal[i] != 0;
    sum[i] += cha[i] != 0;
  }
  for (ll i = 1; i <= q; ++i) {
    ll l = a[i].l >> K, r = a[i].r >> K, L = a[i].l & ((1 << K) - 1),
       R = a[i].r & ((1 << K) - 1);
    if (a[i].v >> Bit & 1)
      ;
    else {
      if (l == r) {
        if (query(pre, l, r) && query(sum, L, R)) return 0;
      } else {
        if (query(pre, l, l) && query(sum, L, n - 1)) return 0;
        if (query(pre, r, r) && query(sum, 0, R)) return 0;
        if (l + 1 < r && query(pre, l + 1, r - 1) && query(sum, 0, n - 1))
          return 0;
      }
    }
  }
  for (ll i = 0; i < n; ++i) {
    if (cal[i]) A[i] |= 1 << Bit;
    if (cha[i]) B[i] |= 1 << Bit;
  }
  return 1;
}
int main() {
  K = read();
  q = read();
  n = 1 << K;
  for (ll i = 1; i <= q; ++i) {
    a[i].l = read();
    a[i].r = read();
    a[i].v = read();
  }
  for (ll i = 0; i < 16; ++i)
    if (!work(i)) {
      puts("impossible");
      return 0;
    }
  puts("possible");
  for (ll i = 0; i < n; ++i) printf("%lld\n", B[i]);
  for (ll i = 0; i < n; ++i) printf("%lld\n", A[i]);
  return 0;
}
