#include <bits/stdc++.h>   #pragma GCC optimize( Ofast,unroll-loops )   #pragma GCC target( avx,avx2,fma )   using namespace std;   template <typename T>   using vc = vector<T>;   template <typename T>   using uset = unordered_set<T>;   template <typename A, typename B>   using umap = unordered_map<A, B>;   template <typename T, typename Comp = less<T>>   using pq = priority_queue<T, vc<T>, Comp>;   template <typename T>   using minpq = pq<T, greater<T>>;   using ld = long double;   using ll = long long;   using ull = unsigned long long;   using pii = pair<int, int>;   using ppi = pair<pii, int>;   using pip = pair<int, pii>;   using vi = vc<int>;   using vii = vc<pii>;   constexpr char el =   n ;   constexpr char sp =    ;   constexpr int INF = 0x3f3f3f3f;   constexpr ll LLINF = 0x3f3f3f3f3f3f3f3fLL;   char g[8][8];   int dr[] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};   int dc[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};   vi a[8][8];   bool good(int r, int c) { return 0 <= r && r < 8 && 0 <= c && c < 8; }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cout << fixed;     for (auto& x : g)       for (auto& y : x) cin >> y;     for (int i = 0; i < 8; ++i)       for (int j = 0; j < 8; ++j)         if (g[i][j] ==  S )           for (int k = i; k < 8; ++k) a[k][j].push_back(k - i);     for (auto& x : a)       for (auto& y : x) sort(y.begin(), y.end());     queue<tuple<int, int, int>> q;     q.emplace(7, 0, 0);     while (!q.empty()) {       auto [r, c, d] = q.front();       q.pop();       for (int i = 0; i < 9; ++i) {         int r1 = r + dr[i];         int c1 = c + dc[i];         if (r1 == 0 && c1 == 7) {           cout <<  WIN ;           exit(0);         }         if (!good(r1, c1) || binary_search(begin(a[r1][c1]), end(a[r1][c1]), d) ||             binary_search(begin(a[r1][c1]), end(a[r1][c1]), d + 1))           continue;         q.emplace(r1, c1, d + 1);       }     }     cout <<  LOSE ;   }   