#include <bits/stdc++.h>
struct Element {
  long long l, r;
  long long v;
};
Element e[200005];
int high[200005][20];
int low[200005][20];
int sumH[200005][20];
int sumL[200005][20];
int keep[40];
int f[200005][2];
long long getHigh(long long u, long long k) {
  u = u >> k;
  long long mask = (1 << k) - 1;
  return u & mask;
}
long long getLow(long long u, long long k) {
  long long mask = (1 << k) - 1;
  return u & mask;
}
void makeTag(int l, int r, int diff[200005][20], int tag) {
  if (l > r) return;
  diff[l][tag]++;
  diff[r + 1][tag]--;
}
int getSegSum(int l, int r, int sum[200005][20], int tag) {
  if (l > r) return 0;
  int res = sum[r][tag];
  if (l != 0) res -= sum[l - 1][tag];
  return res;
}
int judge(int k, int q) {
  int ok = 1;
  long long len = (1 << k), bit = 16;
  for (int rnd = 1; rnd <= q; rnd++) {
    long long mask = e[rnd].v;
    long long l = e[rnd].l, r = e[rnd].r;
    for (int j = 1; j <= bit; j++) {
      keep[j] = mask % 2;
      mask /= 2;
      if (keep[j] == 0) {
        long long hl = getHigh(l, k), hr = getHigh(r, k);
        if (hl + 1 <= hr - 1) {
          int u = getSegSum(hl + 1, hr - 1, sumH, j),
              v = getSegSum(0, len - 1, sumL, j);
          if (u > 0 && v > 0) ok = 0;
        }
        long long ll = getLow(l, k);
        long long lr = (getHigh(l, k) << k) + len - 1;
        if (lr <= r) {
          int u = getSegSum(hl, hl, sumH, j),
              v = getSegSum(ll, len - 1, sumL, j);
          if (u > 0 && v > 0) ok = 0;
        } else {
          lr = getLow(r, k);
          int u = getSegSum(hl, hl, sumH, j), v = getSegSum(ll, lr, sumL, j);
          if (u > 0 && v > 0) ok = 0;
        }
        ll = (getHigh(r, k) << k);
        lr = getLow(r, k);
        if (ll >= l) {
          int u = getSegSum(hr, hr, sumH, j), v = getSegSum(0, lr, sumL, j);
          if (u > 0 && v > 0) ok = 0;
        } else {
          ll = getLow(l, k);
          int u = getSegSum(hr, hr, sumH, j), v = getSegSum(ll, lr, sumL, j);
          if (u > 0 && v > 0) ok = 0;
        }
      }
    }
  }
  return ok;
}
int main() {
  int k, q;
  scanf("%d%d", &k, &q);
  for (int i = 1; i <= q; i++) {
    scanf("%lld%lld%lld", &e[i].l, &e[i].r, &e[i].v);
  }
  long long len = (1 << k);
  int bit = 16;
  for (int i = 1; i <= q; i++) {
    int u = e[i].v;
    long long l = e[i].l, r = e[i].r;
    for (int j = 1; j <= bit; j++) {
      keep[j] = u % 2;
      u /= 2;
    }
    for (int j = 1; j <= bit; j++) {
      if (keep[j] == 0) {
      } else {
        long long ll = getLow(l, k);
        long long lr = (getHigh(l, k) << k) + len - 1;
        if (lr <= r)
          makeTag(ll, len - 1, low, j);
        else {
          lr = getLow(r, k);
          makeTag(ll, lr, low, j);
        }
        ll = (getHigh(r, k) << k);
        lr = getLow(r, k);
        if (ll >= l)
          makeTag(0, lr, low, j);
        else {
          ll = getLow(l, k);
          makeTag(ll, lr, low, j);
        }
        long long hl = getHigh(l, k), hr = getHigh(r, k);
        if (hl + 1 <= hr - 1) makeTag(0, len - 1, low, j);
        makeTag(hl, hr, high, j);
      }
    }
  }
  int hs[20], ls[20];
  for (int i = 1; i <= bit; i++) hs[i] = ls[i] = 0;
  for (int i = 0; i <= len - 1; i++) {
    int hu = 0, lu = 0;
    for (int j = 1; j <= bit; j++) {
      hs[j] += high[i][j];
      ls[j] += low[i][j];
      if (i != 0) sumH[i][j] = sumH[i - 1][j];
      if (i != 0) sumL[i][j] = sumL[i - 1][j];
      if (hs[j] > 0) sumH[i][j]++;
      if (ls[j] > 0) sumL[i][j]++;
      if (hs[j] > 0) hu += (1 << (j - 1));
      if (ls[j] > 0) lu += (1 << (j - 1));
    }
    f[i][0] = lu;
    f[i][1] = hu;
  }
  if (judge(k, q)) {
    printf("possible\n");
    for (int rnd = 0; rnd < 2; rnd++) {
      for (int i = 0; i <= len - 1; i++) printf("%d\n", f[i][rnd]);
    }
  } else
    printf("impossible\n");
  return 0;
}
