func_code_string: #include <bits/stdc++.h>   using namespace std;   struct node {     long long y, z;     long long x;     int choice;   };   node g[2000001];   int cmp(node head, node a) {     if (head.y != a.y) return head.y < a.y;     if (head.z != a.z) return head.z < a.z;     return head.x > a.x;   }   struct info {     int choice;     long long x;   } f[2000001];   int m, n;   int has = 0;   struct self {     int x, y, z;   } s[33];   long long ans;   int choicex, choicey;   int ipow(int i, int k) {     if (k == 0) return 1;     return i * ipow(i, k - 1);   }   int bs(long long y, long long z) {     int l = 1, r = has, mid, ret = 0;     while (l <= r) {       mid = (l + r) >> 1;       if (g[mid].y > y || (g[mid].y == y && g[mid].z >= z)) {         ret = mid;         r = mid - 1;       } else         l = mid + 1;     }     if (g[ret].y == y && g[ret].z == z)       return ret;     else       return 0;   }   void rep(int i, int u) {     if (i == 1) {       int t = u % 3;       if (t == 0) printf( LM n );       if (t == 1) printf( LW n );       if (t == 2) printf( MW n );       return;     }     rep(i - 1, u / 3);     int t = u % 3;     if (t == 0) printf( LM n );     if (t == 1) printf( LW n );     if (t == 2) printf( MW n );   }   void p(int i, int u) {     while (i <= m) {       int t = u % 3;       u /= 3;       i++;       if (t == 0) printf( LM n );       if (t == 1) printf( LW n );       if (t == 2) printf( MW n );     }   }   void print(int l, int r) {     rep(n, l);     p(n + 1, r);   }   int main() {     ans = -1e14;     scanf( %d , &m);     for (int i = 1; i <= m; i++) scanf( %d%d%d , &s[i].x, &s[i].y, &s[i].z);     if (m % 2 == 0)       n = m / 2;     else       n = m / 2 + 1;     for (int i = 0; i < ipow(3, n); i++) {       int v = i;       long long x = 0, y = 0, z = 0;       for (int j = n; j >= 1; j--) {         int k = v % 3, li = j;         long long a = x, b = y;         if (k == 0) {           x += s[li].x;           y += s[li].y;         }         if (k == 1) {           x += s[li].x;           z += s[li].z;         }         if (k == 2) {           y += s[li].y;           z += s[li].z;         }         v /= 3;       }       y -= x;       z -= x;       has++;       g[has].x = x;       g[has].y = y;       g[has].z = z;       g[has].choice = i;     }     sort(g + 1, g + has + 1, cmp);     for (int i = 0; i < ipow(3, m - n); i++) {       int v = i;       long long x = 0, y = 0, z = 0;       for (int j = n + 1; j <= m; j++) {         int k = v % 3, li = j;         if (k == 0) {           x += s[li].x;           y += s[li].y;         }         if (k == 1) {           x += s[li].x;           z += s[li].z;         }         if (k == 2) {           y += s[li].y;           z += s[li].z;         }         v /= 3;       }       y -= x;       z -= x;       int pos = bs(-y, -z);       if (pos != 0)         if (g[pos].x + x > ans) {           ans = g[pos].x + x;           choicex = g[pos].choice;           choicey = i;         }     }     if (ans != -1e14)       print(choicex, choicey);     else       printf( Impossible n );     return 0;   }   