#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, pair<int, int> > mopa;
int ar[25], br[25], cr[25], n, m, prim[25];
void show(int v, int n) {
  for (int mm = v, i = 0; i < n; mm /= 3, i++) {
    int x = mm % 3;
    if (x == 0)
      cout << "LM" << endl;
    else if (x == 1)
      cout << "MW" << endl;
    else if (x == 2)
      cout << "LW" << endl;
  }
}
pair<int, int> maax(pair<int, int> u, pair<int, int> v) {
  if (u.second == 0) return v;
  if (u.first < v.first) swap(u, v);
  return u;
}
int main() {
  ios::sync_with_stdio(false);
  int lala = 0;
  prim[0] = 1;
  for (int i = 1; i <= 14; i++) prim[i] = prim[i - 1] * 3;
  cin >> n;
  m = n / 2;
  n = n - m;
  for (int i = 0; i <= n - 1; i++) cin >> ar[i] >> br[i] >> cr[i];
  for (int mask = 0; mask <= prim[n] - 1; mask++) {
    int mm = mask, a, b, c;
    a = b = c = 0;
    for (int mm = mask, i = 0; i < n; mm /= 3, i++) {
      int x = mm % 3;
      if (x == 0)
        a += ar[i], b += br[i];
      else if (x == 1)
        c += cr[i], b += br[i];
      else if (x == 2)
        a += ar[i], c += cr[i];
    }
    int x = b - a, y = c - a;
    mopa[make_pair(-x, -y)] = maax(mopa[make_pair(-x, -y)], make_pair(a, mask));
    if (!mask) lala = a;
  }
  for (int i = 0; i <= m - 1; i++) cin >> ar[i] >> br[i] >> cr[i];
  int prin = -1000000007, lf, rg;
  for (int mask = 0; mask <= prim[m] - 1; mask++) {
    int mm = mask, a, b, c;
    a = b = c = 0;
    for (int mm = mask, i = 0; i < m; mm /= 3, i++) {
      int x = mm % 3;
      if (x == 0)
        a += ar[i], b += br[i];
      else if (x == 1)
        c += cr[i], b += br[i];
      else if (x == 2)
        a += ar[i], c += cr[i];
    }
    int x = b - a, y = c - a;
    pair<int, int> use = mopa[make_pair(x, y)];
    if (use.second == 0 && use.first != lala) continue;
    if (prin < use.first + a) {
      prin = use.first + a;
      lf = use.second;
      rg = mask;
    }
  }
  if (prin == -1000000007) {
    cout << "Impossible" << endl;
    return 0;
  }
  show(lf, n);
  show(rg, m);
  return 0;
}
