#include <bits/stdc++.h>
using namespace std;
const int N = 30;
const int oo = (1 << 30) - 1;
map<pair<int, int>, pair<int, int> > M;
int A[N], B[N], C[N], v[N];
int n, top, mx = -oo;
pair<int, int> result;
void combine1(int x, int a, int b, int c, int s) {
  if (x > top) {
    pair<int, int> tmp = make_pair(b - a, c - a);
    if (!M.count(tmp) || M[tmp] < make_pair(a, s)) M[tmp] = make_pair(a, s);
    return;
  }
  combine1(x + 1, a + A[x], b + B[x], c, s * 3 + 0);
  combine1(x + 1, a + A[x], b, c + C[x], s * 3 + 1);
  combine1(x + 1, a, b + B[x], c + C[x], s * 3 + 2);
}
void combine2(int x, int a, int b, int c, int s) {
  if (x > n) {
    pair<int, int> tmp = make_pair(a - b, a - c);
    if (M.count(tmp)) {
      int v = M[tmp].first;
      if (v + a > mx) {
        mx = v + a;
        result = make_pair(M[tmp].second, s);
      }
    }
    return;
  }
  combine2(x + 1, a + A[x], b + B[x], c, s * 3 + 0);
  combine2(x + 1, a + A[x], b, c + C[x], s * 3 + 1);
  combine2(x + 1, a, b + B[x], c + C[x], s * 3 + 2);
}
int main() {
  cin >> n;
  for (int i = 1; i < n + 1; ++i) {
    cin >> A[i] >> B[i] >> C[i];
  }
  top = n / 2;
  combine1(1, 0, 0, 0, 0);
  combine2(top + 1, 0, 0, 0, 0);
  if (mx == -oo) {
    cout << "Impossible\n";
  } else {
    for (int i = top; i; i--) v[i] = result.first % 3, result.first /= 3;
    for (int i = n; i > top; i--) v[i] = result.second % 3, result.second /= 3;
    for (int i = 1; i < n + 1; ++i) {
      if (v[i] == 0) cout << "LM\n";
      if (v[i] == 1) cout << "LW\n";
      if (v[i] == 2) cout << "MW\n";
    }
  }
}
