func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, i, a[3][30], half;   long long ans, ans1, ans2;   struct node {     long long x, y, z;     bool operator<(const node& T) const {       if (x != T.x)         return x < T.x;       else if (y != T.y)         return y < T.y;       else         return z < T.z;     }   };   map<node, long long> b;   void pt(long long s, long long s1) {     long long val = 0;     long long temp = s;     long long temp1 = s1;     for (int w = 0; w < half; w++) {       if (s % 3 == 1 || s % 3 == 2) val += a[0][w];       s /= 3;     }     for (int w = half; w < n; w++) {       if (s1 % 3 == 1 || s1 % 3 == 2) val += a[0][w];       s1 /= 3;     }     if (val > ans) {       ans = val;       ans1 = temp;       ans2 = temp1;     }   }   void solve(int ind, long long s, long long r, long long w, long long mask) {     if (ind == -1) {       long long g = min(s, min(r, w));       s -= g;       r -= g;       w -= g;       b[{s, r, w}] = mask;     } else {       solve(ind - 1, s, r + a[1][ind], w + a[2][ind], mask * 3);       solve(ind - 1, s + a[0][ind], r, w + a[2][ind], mask * 3 + 1);       solve(ind - 1, s + a[0][ind], r + a[1][ind], w, mask * 3 + 2);     }   }   void solve1(int ind, long long s, long long r, long long w, long long mask) {     if (ind == half - 1) {       long long g = min(s, min(r, w));       node temp = {s, r, w};       s -= g;       r -= g;       w -= g;       if (s >= r && s >= w) {         if (b[{0, s - r, s - w}]) {           pt(b[{0, s - r, s - w}], mask);         }       }       if (r >= s && r >= w) {         if (b[{r - s, 0, r - w}]) {           pt(b[{r - s, 0, r - w}], mask);         }       }       if (w >= s && w >= r) {         if (b[{w - s, w - r, 0}]) {           pt(b[{w - s, w - r, 0}], mask);         }       }     } else {       solve1(ind - 1, s, r + a[1][ind], w + a[2][ind], mask * 3);       solve1(ind - 1, s + a[0][ind], r, w + a[2][ind], mask * 3 + 1);       solve1(ind - 1, s + a[0][ind], r + a[1][ind], w, mask * 3 + 2);     }   }   int main() {     scanf( %d , &n);     b.clear();     for (i = 0; i < n; i++) scanf( %d%d%d , &a[0][i], &a[1][i], &a[2][i]);     if (n == 1) {       if (a[0][0] == 0 && a[1][0] == 0)         printf( LM n );       else if (a[0][0] == 0 && a[2][0] == 0)         printf( LW n );       else if (a[1][0] == 0 && a[2][0] == 0)         printf( MW n );       else         printf( Impossible n );       return 0;     }     half = (n + 1) / 2;     ans = -1000000000;     solve(half - 1, 0, 0, 0, 0);     solve1(n - 1, 0, 0, 0, 0);     if (ans == -1000000000)       return 0 * printf( Impossible n );     else {       for (i = 0; i < half; i++) {         if (ans1 % 3 == 0)           printf( MW n );         else if (ans1 % 3 == 1)           printf( LW n );         else           printf( LM n );         ans1 /= 3;       }       for (i = half; i < n; i++) {         if (ans2 % 3 == 0)           printf( MW n );         else if (ans2 % 3 == 1)           printf( LW n );         else           printf( LM n );         ans2 /= 3;       }     }   }   