#include <bits/stdc++.h>
using namespace std;
int n, l[30], m[30], w[30], mmax, cnt;
long long fbit3, pw[30];
struct Node {
  int diffx, diffy, sum;
  long long bit3;
  Node(int diffx = 0, int diffy = 0, int sum = 0, long long bit3 = 0)
      : diffx(diffx), diffy(diffy), sum(sum), bit3(bit3) {}
  bool operator<(const Node& A) const {
    if (diffx == A.diffx) {
      if (diffy == A.diffy) return sum > A.sum;
      return diffy < A.diffy;
    }
    return diffx < A.diffx;
  }
} p[int(6e5 + 5)];
void findHalf(int st, int x, int y, int z, long long bit3) {
  if (st == n / 2) {
    p[cnt++] = Node(x - y, x - z, x + y + z, bit3);
    return;
  }
  findHalf(st + 1, x + l[st], y + m[st], z, bit3);
  findHalf(st + 1, x, y + m[st], z + w[st], bit3 + pw[st]);
  findHalf(st + 1, x + l[st], y, z + w[st], bit3 + 2 * pw[st]);
}
void findHalfRemain(int st, int x, int y, int z, long long bit3) {
  if (st == n) {
    int pos = lower_bound(p, p + cnt, Node(y - x, z - x, INT_MAX, bit3)) - p;
    if (pos < cnt) {
      if (p[pos].diffx == y - x && p[pos].diffy == z - x) {
        if (mmax < p[pos].sum + x + y + z) {
          mmax = max(mmax, p[pos].sum + x + y + z);
          fbit3 = bit3 + p[pos].bit3;
        }
      }
    }
    return;
  }
  findHalfRemain(st + 1, x + l[st], y + m[st], z, bit3);
  findHalfRemain(st + 1, x, y + m[st], z + w[st], bit3 + pw[st]);
  findHalfRemain(st + 1, x + l[st], y, z + w[st], bit3 + 2 * pw[st]);
}
int main() {
  ios_base::sync_with_stdio(false);
  scanf("%d", &n);
  pw[0] = 1;
  for (int i = 0; i < int(n); i++) {
    if (i) pw[i] = pw[i - 1] * 3;
    scanf("%d%d%d", &l[i], &m[i], &w[i]);
  }
  findHalf(0, 0, 0, 0, 0);
  sort(p, p + cnt);
  mmax = fbit3 = INT_MIN;
  findHalfRemain(n / 2, 0, 0, 0, 0);
  if (fbit3 < 0)
    printf("Impossible\n");
  else {
    for (int i = 0; i < int(n); i++) {
      int tmp = fbit3 % 3;
      if (!tmp)
        printf("LM\n");
      else if (tmp == 1)
        printf("MW\n");
      else
        printf("LW\n");
      fbit3 /= 3;
    }
  }
  return 0;
}
