#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:13371488228")
using namespace std;
long long n, n2;
map<tuple<long long, long long, long long>, long long> m, mm;
vector<tuple<long long, long long, long long> > d;
long long best = -1e15, ans_l, ans_r;
void gen_left(long long i, long long a, long long b, long long c,
              long long mask) {
  if (i == n2) {
    m[make_tuple(a - b, a - c, b - c)] = mask;
    mm[make_tuple(a - b, a - c, b - c)] = a;
    return;
  }
  gen_left(i + 1, a, b + get<1>(d[i]), c + get<2>(d[i]), mask * 3 + 0);
  gen_left(i + 1, a + get<0>(d[i]), b, c + get<2>(d[i]), mask * 3 + 1);
  gen_left(i + 1, a + get<0>(d[i]), b + get<1>(d[i]), c, mask * 3 + 2);
}
void gen_right(long long i, long long a, long long b, long long c,
               long long mask) {
  if (i == n) {
    if (m.count(make_tuple(-(a - b), -(a - c), -(b - c)))) {
      long long cur = mm[make_tuple(-(a - b), -(a - c), -(b - c))];
      if (cur + a > best) {
        best = cur + a;
        ans_l = m[make_tuple(-(a - b), -(a - c), -(b - c))];
        ans_r = mask;
      }
    }
    return;
  }
  gen_right(i + 1, a, b + get<1>(d[i]), c + get<2>(d[i]), mask * 3 + 0);
  gen_right(i + 1, a + get<0>(d[i]), b, c + get<2>(d[i]), mask * 3 + 1);
  gen_right(i + 1, a + get<0>(d[i]), b + get<1>(d[i]), c, mask * 3 + 2);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  d.resize(n);
  for (long long i = 0; i < n; ++i)
    cin >> get<0>(d[i]) >> get<1>(d[i]) >> get<2>(d[i]);
  n2 = n / 2;
  gen_left(0, 0, 0, 0, 0);
  gen_right(n2, 0, 0, 0, 0);
  if (best == -1e15) {
    cout << "Impossible\n";
    return 0;
  }
  vector<long long> ans1, ans2;
  for (long long i = 0; i < n2; ++i) {
    ans1.push_back(ans_l % 3);
    ans_l /= 3;
  }
  for (long long i = n2; i < n; ++i) {
    ans2.push_back(ans_r % 3);
    ans_r /= 3;
  }
  vector<string> g = {"MW\n", "LW\n", "LM\n"};
  reverse(ans1.begin(), ans1.end());
  reverse(ans2.begin(), ans2.end());
  for (long long i = 0; i < n2; ++i) cout << g[ans1[i]];
  for (long long i = n2; i < n; ++i) cout << g[ans2[i - n2]];
  return 0;
}
