#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e9 + 333;
const int N = 25 + 5;
int n, m;
int a[N], b[N], c[N];
int ans = -inf;
int power[N >> 1];
map<long long, pair<int, int> > M;
int curRoad;
long long sAns;
inline void goD(int x, int end, int sum1 = 0, int sum2 = 0, int sum3 = 0) {
  if (x > end) {
    long long res = (long long)(sum2 - sum1 + inf) * 2 * inf + sum3 - sum1;
    __typeof((M).begin()) it = M.find(res);
    int val = it != M.end() ? it->second.first : -inf;
    if (sum1 > val) {
      if (val == -inf)
        M[res] = pair<int, int>(sum1, curRoad);
      else
        it->second = pair<int, int>(sum1, curRoad);
    }
    return;
  }
  goD(x + 1, end, sum1 + a[x], sum2 + b[x], sum3);
  curRoad += power[x - 1];
  goD(x + 1, end, sum1 + a[x], sum2, sum3 + c[x]);
  curRoad += power[x - 1];
  goD(x + 1, end, sum1, sum2 + b[x], sum3 + c[x]);
  curRoad -= power[x - 1];
  curRoad -= power[x - 1];
}
inline void goU(int x, int end, int sum1 = 0, int sum2 = 0, int sum3 = 0) {
  if (x < end) {
    long long res = (long long)(sum1 - sum2 + inf) * 2 * inf + sum1 - sum3;
    __typeof((M).begin()) it = M.find(res);
    if (it != M.end()) {
      int val = it->second.first;
      int road = it->second.second;
      if (sum1 + val > ans) {
        ans = sum1 + val;
        sAns = road + (long long)curRoad * power[m];
      }
    }
    return;
  }
  goU(x - 1, end, sum1 + a[x], sum2 + b[x], sum3);
  curRoad += power[x - m - 1];
  goU(x - 1, end, sum1 + a[x], sum2, sum3 + c[x]);
  curRoad += power[x - m - 1];
  goU(x - 1, end, sum1, sum2 + b[x], sum3 + c[x]);
  curRoad -= power[x - m - 1];
  curRoad -= power[x - m - 1];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d %d", a + i, b + i, c + i);
  }
  m = (n + 1) >> 1;
  power[0] = 1;
  for (int i = 1; i < (N >> 1); i++) {
    power[i] = power[i - 1] * 3;
  }
  goD(1, m);
  goU(n, m + 1);
  if (ans == -inf) {
    puts("Impossible");
  } else {
    for (int i = 0; i < n; i++) {
      if (sAns % 3 == 0)
        puts("LM");
      else if (sAns % 3 == 1)
        puts("LW");
      else
        puts("MW");
      sAns /= 3;
    }
  }
  return 0;
}
