#include <bits/stdc++.h>
using namespace std;
struct SegmentTree {
  vector<long long> t;
  vector<long long> mod;
  void update(long long v, long long x) {
    t[v] |= x;
    mod[v] |= x;
  }
  void push(long long v) {
    if (mod[v]) {
      update(2 * v + 1, mod[v]);
      update(2 * v + 2, mod[v]);
      mod[v] = 0;
    }
  }
  long long n;
  void modify(long long ql, long long qr, long long val, long long l,
              long long r, long long v) {
    if (qr < l || r < ql) return;
    if (ql <= l && r <= qr) {
      update(v, val);
    } else {
      push(v);
      long long m = (l + r) >> 1;
      modify(ql, qr, val, l, m, 2 * v + 1);
      modify(ql, qr, val, m + 1, r, 2 * v + 2);
    }
  }
  long long get(long long ql, long long qr, long long l, long long r,
                long long v) {
    if (qr < l || r < ql) return 0;
    if (ql <= l && r <= qr) return t[v];
    push(v);
    long long m = (l + r) >> 1;
    return get(ql, qr, l, m, 2 * v + 1) | get(ql, qr, m + 1, r, 2 * v + 2);
  }
  SegmentTree(long long nn) {
    n = nn;
    t.resize(4 * n, 0);
    mod.resize(4 * n, 0);
  }
};
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long k, q;
  cin >> k >> q;
  vector<long long> l(q), r(q), v(q);
  for (long long i = 0; i < q; ++i) {
    cin >> l[i] >> r[i] >> v[i];
  }
  long long x = (1 << k);
  SegmentTree low(x), high(x);
  for (long long i = 0; i < q; ++i) {
    long long high_l = (l[i] >> k);
    long long low_l = (l[i] & (x - 1));
    long long high_r = (r[i] >> k);
    long long low_r = (r[i] & (x - 1));
    if (high_l == high_r) {
      high.modify(high_l, high_r, v[i], 0, x - 1, 0);
      low.modify(low_l, low_r, v[i], 0, x - 1, 0);
    } else {
      if (high_l + 1 <= high_r - 1) {
        high.modify(high_l + 1, high_r - 1, v[i], 0, x - 1, 0);
        low.modify(0, x - 1, v[i], 0, x - 1, 0);
      }
      high.modify(high_l, high_l, v[i], 0, x - 1, 0);
      low.modify(low_l, x - 1, v[i], 0, x - 1, 0);
      high.modify(high_r, high_r, v[i], 0, x - 1, 0);
      low.modify(0, low_r, v[i], 0, x - 1, 0);
    }
  }
  vector<long long> lt(x), ht(x);
  for (long long i = 0; i < x; ++i) {
    lt[i] = low.get(i, i, 0, x - 1, 0);
    ht[i] = high.get(i, i, 0, x - 1, 0);
  }
  for (long long i = 0; i < q; ++i) {
    long long high_l = (l[i] >> k);
    long long low_l = (l[i] & (x - 1));
    long long high_r = (r[i] >> k);
    long long low_r = (r[i] & (x - 1));
    if (high_l == high_r) {
      long long h = ht[high_l];
      long long l = low.get(low_l, low_r, 0, x - 1, 0);
      if ((h & l) != v[i]) {
        cout << "impossible\n";
        return 0;
      }
    } else {
      long long h = ht[high_l];
      long long l = low.get(low_l, x - 1, 0, x - 1, 0);
      if ((h & l) != v[i]) {
        cout << "impossible\n";
        return 0;
      }
      h = ht[high_r];
      l = low.get(0, low_r, 0, x - 1, 0);
      if ((h & l) != v[i]) {
        cout << "impossible\n";
        return 0;
      }
      if (high_l + 1 <= high_r - 1) {
        h = high.get(high_l + 1, high_r - 1, 0, x - 1, 0);
        l = low.get(0, x - 1, 0, x - 1, 0);
        if ((h & l) != v[i]) {
          cout << "impossible\n";
          return 0;
        }
      }
    }
  }
  cout << "possible\n";
  for (long long i = 0; i < x; ++i) {
    cout << lt[i] << '\n';
  }
  for (long long i = 0; i < x; ++i) {
    cout << ht[i] << '\n';
  }
}
