func_code_string: #include <bits/stdc++.h>   using namespace std;   char g[10][10];   int ax[10 * 10], n;   bool use[10 * 10];   int q[2][100], ct[2], vst[8][8];   int dx[9] = {0, 0, 0, 1, -1, 1, 1, -1, -1};   int dy[9] = {0, 1, -1, 0, 0, -1, 1, -1, 1};   bool check(int x, int y) {     if (x < 0 || y < 0 || x >= 8 || y >= 8) return 0;     if (vst[x][y]) return 0;     for (int i = 0; i < n; i++)       if (ax[i] % 8 == y && (ax[i] / 8 == x || ax[i] / 8 == x - 1)) return 0;     return 1;   }   int bfs() {     q[0][0] = 7 * 8;     ct[0] = 1;     for (int i = 0; i < 10; i++) {       int id = i & 1, nid = id ^ 1;       ct[nid] = 0;       memset(vst, 0, sizeof(vst));       for (int j = 0; j < ct[id]; j++) {         int u = q[id][j];         int x = u / 8, y = u % 8;         for (int d = 0; d < 9; d++) {           int nx = x + dx[d], ny = y + dy[d];           if (check(nx, ny)) q[nid][ct[nid]++] = nx * 8 + ny, vst[nx][ny] = 1;           if (nx == 0 && ny == 7) return 1;         }       }       for (int j = 0; j < n; j++) ax[j] = (ax[j] / 8 + 1) * 8 + ax[j] % 8;     }     if (ct[0]) return 1;     return 0;   }   int main() {     n = 0;     for (int i = 0; i < 8; i++) {       scanf( %s , g[i]);       for (int j = 0; j < 8; j++)         if (g[i][j] ==  S ) ax[n++] = i * 8 + j;     }     if (bfs())       puts( WIN );     else       puts( LOSE );     return 0;   }   