#include <bits/stdc++.h>
using namespace std;
struct girl {
  int l, m, w;
  int num;
};
int n;
int l[25], m[25], w[25];
vector<int> mul;
girl dleft[1594333], dright[1594333];
vector<int> cur;
map<pair<pair<int, int>, int>, int> gg;
void solve(int side) {
  if (side == 1 && cur.size() == n / 2) {
    int num = 0;
    int ll = 0, mm = 0, ww = 0;
    for (int i = 0; i < cur.size(); i++) {
      if (cur[i] == 0) ll += l[i], mm += m[i];
      if (cur[i] == 1) ll += l[i], ww += w[i];
      if (cur[i] == 2) mm += m[i], ww += w[i];
      num += cur[i] * mul[n / 2 - 1 - i];
    }
    dleft[num].l = ll;
    dleft[num].m = mm;
    dleft[num].w = ww;
    dleft[num].num = num;
    return;
  }
  if (side == 2 && cur.size() == n - n / 2) {
    int num = 0;
    int ll = 0, mm = 0, ww = 0;
    for (int i = 0; i < cur.size(); i++) {
      if (cur[i] == 0) ll += l[n / 2 + i], mm += m[n / 2 + i];
      if (cur[i] == 1) ll += l[n / 2 + i], ww += w[n / 2 + i];
      if (cur[i] == 2) mm += m[n / 2 + i], ww += w[n / 2 + i];
      num += cur[i] * mul[n - n / 2 - 1 - i];
    }
    dright[num].l = ll;
    dright[num].m = mm;
    dright[num].w = ww;
    dright[num].num = num;
    pair<pair<int, int>, int> para =
        make_pair(make_pair(mm - ll, ww - mm), ll - ww);
    if (gg[para] == 0) {
      gg[para] = num + 1;
    } else {
      if (dright[gg[para] - 1].l < dright[num].l) {
        gg[para] = num + 1;
      }
    }
    return;
  }
  for (int i = 0; i < 3; i++) {
    cur.push_back(i);
    solve(side);
    cur.pop_back();
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> l[i] >> m[i] >> w[i];
  int t = 1;
  for (int i = 0; i <= 13; i++) {
    mul.push_back(t);
    t *= 3;
  }
  solve(1);
  solve(2);
  int mxAns = -1000000000;
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < mul[n / 2]; i++) {
    girl current = dleft[i];
    int num = gg[make_pair(
        make_pair(-(current.m - current.l), -(current.w - current.m)),
        -(current.l - current.w))];
    if (num != 0) {
      if (mxAns < dleft[i].l + dright[num - 1].l) {
        mxAns = dleft[i].l + dright[num - 1].l;
        ans1 = dleft[i].num;
        ans2 = dright[num - 1].num;
      }
    }
  }
  if (mxAns == -1000000000)
    cout << "Impossible" << endl;
  else {
    for (int i = 0; i < n / 2; i++) {
      if (2 * mul[n / 2 - 1 - i] <= ans1) {
        cout << "MW" << endl;
        ans1 -= 2 * mul[n / 2 - 1 - i];
      } else {
        if (mul[n / 2 - 1 - i] <= ans1) {
          cout << "LW" << endl;
          ans1 -= mul[n / 2 - 1 - i];
        } else {
          cout << "LM" << endl;
        }
      }
    }
    for (int i = 0; i < n - n / 2; i++) {
      if (2 * mul[n - n / 2 - 1 - i] <= ans2) {
        cout << "MW" << endl;
        ans2 -= 2 * mul[n - n / 2 - 1 - i];
      } else {
        if (mul[n - n / 2 - 1 - i] <= ans2) {
          cout << "LW" << endl;
          ans2 -= mul[n - n / 2 - 1 - i];
        } else
          cout << "LM" << endl;
      }
    }
  }
  return 0;
}
