typedef complex<int> P;
P dirs[] = {
P(0, 0),
P(1, 0), P(0, 1), P(-1, 0), P(0, -1),
P(1, 1), P(1,-1), P(-1, 1), P(-1, -1),
};
#define X real()
#define Y imag()
namespace std{
bool operator<(const P &a, const P &b){
return a.X == b.X ? a.Y < b.Y : a.X < b.X;
}
};
bool inBoard(P p){
return 0 <= p.X && p.X < 8 &&
0 <= p.Y && p.Y < 8;
}
bool solve(){
set<P> statue;
rep(i, 8){
rep(j, 8){
char c; cin >> c;
if(c == 'S') statue.insert(P(i, j));
}
}
vector<vvi> dp(40);
repsz(i, dp) dp[i] = vvi(8, vi(8));
dp[0][7][0] = 1;
rep(turn, sz(dp)-1){
rep(i, 8) rep(j, 8) if(dp[turn][i][j]){
rep(dir, 9){
P np = P(i, j) + dirs[dir];
if(!inBoard(np)) continue;
if(statue.count(np - P(turn, 0))) continue;
if(statue.count(np - P(turn+1, 0))) continue;
dp[turn+1][np.X][np.Y] = 1;
}
}
}
if(dp[sz(dp)-1][0][7]){
cout << "WIN" << endl;
}else{
cout << "LOSE" << endl;
}
return true;
}