#include <bits/stdc++.h>
using namespace std;
struct node {
  pair<int, int> sum, stat;
  bool operator<(const node &a) const {
    if (a.sum.first == sum.first) return a.sum.second > sum.second;
    return a.sum.first > sum.first;
  }
} res[2000000 + 10];
int n, a[25 + 10], b[25 + 10], c[25 + 10], cnt, tot = -2147483647, S1, S2,
                                                r[2000000 + 10];
void read() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d%d", &a[i], &b[i], &c[i]);
}
void dfs1(int dep, int asum, int bsum, int csum, int stat) {
  if (dep == n / 2) {
    res[cnt].sum = make_pair(asum - bsum, bsum - csum);
    res[cnt].stat = make_pair(asum, stat);
    cnt++;
    return;
  }
  for (int i = 0; i < 3; i++) {
    int x = asum, y = bsum, z = csum;
    if (i != 0) x += a[dep];
    if (i != 1) y += b[dep];
    if (i != 2) z += c[dep];
    dfs1(dep + 1, x, y, z, stat * 3 + i);
  }
}
void dfs2(int dep, int asum, int bsum, int csum, int stat) {
  if (dep == n) {
    node t;
    t.sum = make_pair(bsum - asum, csum - bsum);
    t.stat = make_pair(asum, stat);
    int pos = lower_bound(res, res + cnt, t) - res;
    if (pos < cnt && res[pos].sum.first == t.sum.first &&
        res[pos].sum.second == t.sum.second) {
      if (res[pos].stat.first + t.stat.first > tot) {
        tot = res[pos].stat.first + t.stat.first;
        S1 = res[pos].stat.second, S2 = t.stat.second;
      }
    }
    return;
  }
  for (int i = 0; i < 3; i++) {
    int x = asum, y = bsum, z = csum;
    if (i != 0) x += a[dep];
    if (i != 1) y += b[dep];
    if (i != 2) z += c[dep];
    dfs2(dep + 1, x, y, z, stat * 3 + i);
  }
}
void print() {
  if (tot == -2147483647) {
    printf("Impossible\n");
    return;
  }
  int rcnt = 0;
  for (int j = 0; j < n / 2; S1 /= 3, j++) r[rcnt++] = S1 % 3;
  for (int i = rcnt - 1; i >= 0; i--) {
    if (!r[i])
      puts("MW");
    else if (r[i] == 1)
      puts("LW");
    else
      puts("LM");
  }
  rcnt = 0;
  for (int j = n / 2; j < n; S2 /= 3, j++) r[rcnt++] = S2 % 3;
  for (int i = rcnt - 1; i >= 0; i--) {
    if (!r[i])
      puts("MW");
    else if (r[i] == 1)
      puts("LW");
    else
      puts("LM");
  }
}
void meet_middle() {
  dfs1(0, 0, 0, 0, 0);
  sort(res, res + cnt);
  for (int i = 0; i < cnt;) {
    int j = i, mxa = res[i].stat.first, mxs = res[i].stat.second;
    while (res[j].sum.first == res[j + 1].sum.first &&
           res[j].sum.second == res[j + 1].sum.second && j < cnt - 1) {
      if (res[j + 1].stat.first > mxa)
        mxa = res[j + 1].stat.first, mxs = res[j + 1].stat.second;
      j++;
    }
    for (; i <= j; i++) res[i].stat.first = mxa, res[i].stat.second = mxs;
  }
  dfs2(n / 2, 0, 0, 0, 0);
  print();
}
int main() {
  read();
  meet_middle();
}
