#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long INF = 1e18;
const int M = 1e9 + 7;
const int maxn = 1e7;
int a[33], b[33], c[33], tt[maxn];
int three[33];
int temp = 0;
pair<int, int> run(int num, int l, int r) {
  int x = 0, y = 0, z = 0;
  for (int i = l; i < r; ++i) {
    int t = num % 3;
    x += a[i], y += b[i], z += c[i];
    if (t == 0) {
      x -= a[i];
    } else if (t == 1) {
      y -= b[i];
      temp += a[i];
    } else if (t == 2) {
      z -= c[i];
      temp += a[i];
    }
    num /= 3;
  }
  return pair<int, int>(y - x, z - x);
}
long long cx = 0, cy = 0, cz = 0;
void output(int num, int l, int r) {
  for (int i = l; i < r; ++i) {
    int t = num % 3;
    cx += a[i], cy += b[i], cz += c[i];
    if (t == 0) {
      cout << "MW" << endl;
      cx -= a[i];
    } else if (t == 1) {
      cout << "LW" << endl;
      cy -= b[i];
    } else {
      cout << "LM" << endl;
      cz -= c[i];
    }
    num /= 3;
  }
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  three[0] = 3;
  for (int i = 1; i < 15; ++i) {
    three[i] = 3 * three[i - 1];
  }
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i] >> c[i];
  }
  int m = n / 2;
  unordered_map<long long, int> h;
  for (int i = 0; i < three[m]; ++i) {
    temp = 0;
    pair<long long, long long> cur = run(i, 0, m);
    long long cc = cur.first * inf + cur.second;
    if (h.count(cc)) {
      int x = h[cc];
      if (temp > tt[x]) {
        h[cc] = i;
      }
    } else {
      h[cc] = i;
    }
    tt[i] = temp;
  }
  int tot = -inf;
  pair<int, int> res;
  for (int i = 0; i < three[n - m]; ++i) {
    temp = 0;
    pair<long long, long long> cur = run(i, m, n);
    if (h.count(-cur.first * inf - cur.second)) {
      int num = h[-cur.first * inf - cur.second];
      int t = tt[num] + temp;
      if (t > tot) {
        tot = t;
        res = pair<int, int>(num, i);
      }
    }
  }
  if (tot == -inf)
    cout << "Impossible" << endl;
  else {
    output(res.first, 0, m);
    output(res.second, m, n);
  }
  return 0;
}
