#include <bits/stdc++.h>
using namespace std;
int n;
int a[25][3];
int bestsum, bc0, bc1;
map<pair<int, int>, pair<int, int> > dp;
void find(int half, int code, int s0, int s1, int s2, int pos, int limit) {
  if (pos == limit) {
    int p1 = s1 - s0;
    int p2 = s2 - s0;
    pair<int, int> pp;
    if (!half) {
      pp = make_pair(p1, p2);
      pair<int, int> old =
          dp.find(pp) != dp.end() ? dp[pp] : make_pair(s0 - 1, 0);
      pair<int, int> cur = make_pair(s0, code);
      if (cur > old) dp[pp] = cur;
    } else {
      pp = make_pair(-p1, -p2);
      if (dp.find(pp) != dp.end()) {
        pair<int, int> old = dp[pp];
        int sum = s0 + old.first;
        if (sum > bestsum) {
          bestsum = sum;
          bc0 = old.second;
          bc1 = code;
        }
      }
    }
    return;
  }
  find(half, code * 3 + 0, s0 + 000000000, s1 + a[pos][1], s2 + a[pos][2],
       pos + 1, limit);
  find(half, code * 3 + 1, s0 + a[pos][0], s1 + 000000000, s2 + a[pos][2],
       pos + 1, limit);
  find(half, code * 3 + 2, s0 + a[pos][0], s1 + a[pos][1], s2 + 000000000,
       pos + 1, limit);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 3; j++) cin >> a[i][j];
  int mid = n / 2;
  find(0, 0, 0, 0, 0, 0, mid);
  bestsum = -1000000000;
  find(1, 0, 0, 0, 0, mid, n);
  if (bestsum == -1000000000)
    cout << "Impossible";
  else {
    vector<int> result(n);
    for (int i = n - 1; i >= mid; i--, bc1 /= 3) result[i] = bc1 % 3;
    for (int i = mid - 1; i >= 0; i--, bc0 /= 3) result[i] = bc0 % 3;
    for (int i = 0; i < n; i++)
      cout << (result[i] == 0 ? "MW" : result[i] == 1 ? "LW" : "LM") << endl;
  }
  return 0;
}
