#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
using ll = long long;
using DBL = double;
using VI = vector<int>;
using VD = vector<DBL>;
using VVI = vector<VI>;
using VVD = vector<VD>;
const int MAXN = 200010;
long long l[MAXN], r[MAXN], v[MAXN];
int k;
long long msbk(long long x) { return x >> k; }
long long lsbk(long long x) { return (x & ((1 << k) - 1)); }
int setmsb[(1 << 16) + 1], setlsb[(1 << 16) + 1];
int suffmsb[(1 << 16) + 1], sufflsb[(1 << 16) + 1];
int ansmsb[(1 << 16) + 1], anslsb[(1 << 16) + 1];
void impossible() {
  cout << "impossible\n";
  exit(0);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q;
  cin >> k >> q;
  for (int i = 1; i <= q; ++i) {
    cin >> l[i] >> r[i] >> v[i];
  }
  for (int b = 0; b < 16; ++b) {
    memset(setmsb, 0, sizeof(setmsb));
    memset(setlsb, 0, sizeof(setlsb));
    for (int i = 1; i <= q; ++i) {
      if (((v[i]) & (1 << b)) == 0) continue;
      ++setmsb[msbk(l[i])];
      --setmsb[1 + msbk(r[i])];
      if (msbk(l[i]) == msbk(r[i])) {
        ++setlsb[lsbk(l[i])];
        --setlsb[1 + lsbk(r[i])];
      } else if (msbk(l[i]) + 1 == msbk(r[i])) {
        ++setlsb[lsbk(l[i])];
        --setlsb[1 << k];
        ++setlsb[0];
        --setlsb[1 + lsbk(r[i])];
      } else {
        ++setlsb[0];
        --setlsb[1 << k];
      }
    }
    for (int j = 1; j <= (1 << k); ++j) {
      setmsb[j] += setmsb[j - 1];
      setlsb[j] += setlsb[j - 1];
    }
    for (int j = 0; j <= (1 << k); ++j) {
      if (setmsb[j]) setmsb[j] = 1;
      if (setlsb[j]) setlsb[j] = 1;
      ansmsb[j] |= (setmsb[j] << b);
      anslsb[j] |= (setlsb[j] << b);
    }
    for (int j = (1 << k) - 1; j >= 0; --j) {
      sufflsb[j] = sufflsb[j + 1] + setlsb[j];
      suffmsb[j] = suffmsb[j + 1] + setmsb[j];
    }
    assert(setlsb[1 << k] == 0);
    assert(setmsb[1 << k] == 0);
    assert(sufflsb[1 << k] == 0);
    assert(suffmsb[1 << k] == 0);
    for (int i = 1; i <= q; ++i) {
      if (((v[i]) & (1 << b)) == (1 << b)) continue;
      if (msbk(l[i]) == msbk(r[i])) {
        if (setmsb[msbk(l[i])] and
            (sufflsb[lsbk(l[i])] - sufflsb[1 + lsbk(r[i])])) {
          impossible();
        }
      } else {
        if (setmsb[msbk(l[i])] and (sufflsb[lsbk(l[i])] - sufflsb[1 << k]))
          impossible();
        if (setmsb[msbk(r[i])] and (sufflsb[0] - sufflsb[1 + lsbk(r[i])]))
          impossible();
        if ((msbk(l[i]) + 1 <= msbk(r[i]) - 1) and
            (suffmsb[msbk(l[i]) + 1] - suffmsb[msbk(r[i])]) and
            (sufflsb[0] - sufflsb[1 << k]))
          impossible();
      }
    }
  }
  cout << "possible\n";
  for (int j = 0; j < (1 << k); ++j) {
    cout << anslsb[j] << endl;
  }
  for (int j = 0; j < (1 << k); ++j) {
    cout << ansmsb[j] << endl;
  }
  return 0;
}
