#include <bits/stdc++.h>
using namespace std;
const int N = 30;
int n, r, hf, hv, mf, mv, Mx = -1e9, L[N], M[N], W[N];
pair<int, int> res;
map<pair<int, int>, pair<int, int> > F;
int Power(int a, int b) {
  if (b == 0) return (1);
  int tt = Power(a, b / 2);
  tt *= tt;
  if (b & 1) tt *= a;
  return (tt);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d%d", &L[i], &M[i], &W[i]);
  hf = n / 2;
  hv = n - hf;
  mf = Power(3, hf);
  mv = Power(3, hv);
  for (int i = 0; i < mf; i++) {
    r = i;
    int ll, mm, ww;
    ll = mm = ww = 0;
    for (int j = 0; j < hf; j++) {
      if (r % 3 == 0) mm += M[j], ww += W[j];
      if (r % 3 == 1) ll += L[j], ww += W[j];
      if (r % 3 == 2) mm += M[j], ll += L[j];
      r /= 3;
    }
    if (F.count({ll - mm, ll - ww}) != 0) {
      if (F[{ll - mm, ll - ww}].first < ll) F[{ll - mm, ll - ww}] = {ll, i};
    } else
      F[{ll - mm, ll - ww}] = {ll, i};
  }
  for (int i = 0; i < mv; i++) {
    r = i;
    int ll, mm, ww;
    ll = mm = ww = 0;
    for (int j = hf; j < n; j++) {
      if (r % 3 == 0) mm += M[j], ww += W[j];
      if (r % 3 == 1) ll += L[j], ww += W[j];
      if (r % 3 == 2) mm += M[j], ll += L[j];
      r /= 3;
    }
    if (F.count({mm - ll, ww - ll}) == 0) continue;
    auto X = F[{mm - ll, ww - ll}];
    if (Mx < X.first + ll) {
      Mx = X.first + ll;
      res = {X.second, i};
    }
  }
  if (Mx == -1e9) return !printf("Impossible");
  for (int i = 0; i < hf; i++) {
    if (res.first % 3 == 0) printf("MW\n");
    if (res.first % 3 == 1) printf("LW\n");
    if (res.first % 3 == 2) printf("LM\n");
    res.first /= 3;
  }
  for (int i = 0; i < hv; i++) {
    if (res.second % 3 == 0) printf("MW\n");
    if (res.second % 3 == 1) printf("LW\n");
    if (res.second % 3 == 2) printf("LM\n");
    res.second /= 3;
  }
  return (0);
}
