#include <bits/stdc++.h>
using namespace std;
const int N = 25;
const int INF = 1e9;
map<pair<int, int>, pair<int, long long int> > dpl, dpm, dpw;
int n, l[N], m[N], w[N];
long long int pw[N];
vector<int> v;
pair<int, long long int> ans = {-INF, -INF};
void f(int x, int dl, int dm, int dw, long long int mask) {
  if (x == n / 2) {
    int mn = min(dl, min(dm, dw));
    if (mn == dl) {
      if (dpl.find({dm - dl, dw - dl}) == dpl.end())
        dpl[{dm - dl, dw - dl}] = {dl, mask};
      else
        dpl[{dm - dl, dw - dl}] = max(dpl[{dm - dl, dw - dl}], {dl, mask});
    }
    if (mn == dm) {
      if (dpm.find({dl - dm, dw - dm}) == dpm.end())
        dpm[{dl - dm, dw - dm}] = {dm, mask};
      else
        dpm[{dl - dm, dw - dm}] = max(dpm[{dl - dm, dw - dm}], {dm, mask});
    }
    if (mn == dw) {
      if (dpw.find({dl - dw, dm - dw}) == dpw.end())
        dpw[{dl - dw, dm - dw}] = {dw, mask};
      else
        dpw[{dl - dw, dm - dw}] = max(dpw[{dl - dw, dm - dw}], {dw, mask});
    }
    return;
  }
  f(x + 1, dl, dm + m[x], dw + w[x], mask + pw[x] * 0);
  f(x + 1, dl + l[x], dm, dw + w[x], mask + pw[x] * 1);
  f(x + 1, dl + l[x], dm + m[x], dw, mask + pw[x] * 2);
}
void f2(int x, int dl, int dm, int dw, long long int mask) {
  if (x == n) {
    int mx = max(dl, max(dm, dw));
    if (mx == dl) {
      if (dpl.find({dl - dm, dl - dw}) != dpl.end()) {
        auto temp = dpl[{dl - dm, dl - dw}];
        ans = max(ans, {temp.first + dl, mask + temp.second});
      }
    }
    if (mx == dm) {
      if (dpm.find({dm - dl, dm - dw}) != dpm.end()) {
        auto temp = dpm[{dm - dl, dm - dw}];
        ans = max(ans, {temp.first + dm, mask + temp.second});
      }
    }
    if (mx == dw) {
      if (dpw.find({dw - dl, dw - dm}) != dpw.end()) {
        auto temp = dpw[{dw - dl, dw - dm}];
        ans = max(ans, {temp.first + dw, mask + temp.second});
      }
    }
    return;
  }
  f2(x + 1, dl, dm + m[x], dw + w[x], mask + pw[x] * 0);
  f2(x + 1, dl + l[x], dm, dw + w[x], mask + pw[x] * 1);
  f2(x + 1, dl + l[x], dm + m[x], dw, mask + pw[x] * 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> l[i] >> m[i] >> w[i];
  pw[0] = 1;
  for (int i = 1; i < n; i++) pw[i] = pw[i - 1] * 3;
  f(0, 0, 0, 0, 0);
  f2(n / 2, 0, 0, 0, 0);
  if (ans.first == -INF) {
    cout << "Impossible\n";
    return 0;
  }
  long long int mask = ans.second;
  while (1) {
    v.push_back(mask % 3);
    if (mask == 0) break;
    mask /= 3;
  }
  for (int i = 0; i < n; i++) {
    if (v[i] == 0) cout << "MW";
    if (v[i] == 1) cout << "LW";
    if (v[i] == 2) cout << "LM";
    cout << endl;
  }
}
