#include <bits/stdc++.h>
typedef struct {
  int x, y, z;
} mycreation;
mycreation a[1600000 + 1], b[1600000 + 1];
int k, sumx, sumy, sumz, boss[25], sol[25], lim, start, m[25][3];
bool cmp(const mycreation a, const mycreation b) {
  return ((a.y < b.y) ||
          ((a.y == b.y) && ((a.z < b.z) || ((a.z == b.z) && (a.x < b.x)))));
}
inline bool ok(mycreation a, mycreation b) {
  return ((a.y < -b.y) || ((a.y == -b.y) && (a.z <= -b.z)));
}
void bkt(int p, mycreation v[]) {
  if (p == lim) {
    v[++k].x = sumx;
    v[k].y = sumx - sumy;
    v[k].z = sumy - sumz;
    return;
  }
  sumx += m[p][0];
  sumy += m[p][1];
  bkt(p + 1, v);
  sumx -= m[p][0];
  sumz += m[p][2];
  bkt(p + 1, v);
  sumy -= m[p][1];
  sumx += m[p][0];
  bkt(p + 1, v);
  sumx -= m[p][0];
  sumz -= m[p][2];
}
void find(int p, mycreation e) {
  if (p == lim) {
    if ((e.x == sumx) && (e.y == sumx - sumy) && (e.z == sumy - sumz)) {
      for (int i = start; i < lim; i++) {
        sol[i] = boss[i];
      }
    }
    return;
  }
  sumx += m[p][0];
  sumy += m[p][1];
  boss[p] = 0;
  find(p + 1, e);
  sumx -= m[p][0];
  sumz += m[p][2];
  boss[p] = 1;
  find(p + 1, e);
  sumy -= m[p][1];
  sumx += m[p][0];
  boss[p] = 2;
  find(p + 1, e);
  sumx -= m[p][0];
  sumz -= m[p][2];
}
int main() {
  int n, i, ck, ans, rez, pas;
  mycreation g, h;
  fscanf(stdin, "%d", &n);
  for (i = 0; i < n; i++) {
    fscanf(stdin, "%d%d%d", &m[i][0], &m[i][1], &m[i][2]);
  }
  lim = n / 2;
  k = 0;
  bkt(0, a);
  ck = k;
  k = 0;
  lim = n;
  bkt(n / 2, b);
  std::sort(a + 1, a + ck + 1, cmp);
  ans = -1000000000;
  for (i = 1; i <= k; i++) {
    rez = 0;
    for (pas = 1 << 19; pas; pas >>= 1) {
      if ((rez + pas <= ck) && (ok(a[rez + pas], b[i]))) {
        rez += pas;
      }
    }
    if ((a[rez].y == -b[i].y) && (a[rez].z == -b[i].z) &&
        (b[i].x + a[rez].x > ans)) {
      ans = b[i].x + a[rez].x;
      g = a[rez];
      h = b[i];
    }
  }
  if (ans != -1000000000) {
    start = 0;
    lim = n / 2;
    find(0, g);
    start = n / 2;
    lim = n;
    find(n / 2, h);
    for (i = 0; i < lim; i++) {
      if (sol[i] == 0) {
        fprintf(stdout, "LM\n");
      } else if (sol[i] == 1) {
        fprintf(stdout, "MW\n");
      } else {
        fprintf(stdout, "LW\n");
      }
    }
  } else {
    fprintf(stdout, "Impossible\n");
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}
