#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #ifdef local #include <C++/core/io/debug_print.hpp> #else #define dump(...) void(0); #endif #include <iostream> #include <ranges> #include <cassert> #include <unordered_set> namespace man { } int main() { std::cin.tie(nullptr) -> sync_with_stdio(false); using namespace std::views; char a; std::cin >> a; std::unordered_set<std::string> t; while(true) { std::string s; bool filled = true; s += std::to_string(a); for(const auto c: iota('a', 'z' + 1)) { s += std::to_string(c); if(t.contains(s)) { s.pop_back(); } else { std::cout << '?' << s << std::endl; filled = false; } } if(filled) { std::cout << "! LOSE" << std::endl; } char dummy; std::cin >> dummy >> s; assert(std::ssize(s) == 2); if(t.contains(s)) { break; } t.emplace(s); a = s.back(); } std::cout << "! WIN" << std::endl; }