#include using namespace std; typedef long double ld; int n, m, k, mxx, mxy, mnx, mny; string s; int main(){ ios_base::sync_with_stdio(0);cin.tie(0); cin >>n>>m>>k; mnx = mny = 2e9; for (int i = 1; i <= k; ++i){ int x, y; cin >>x>>y; mxx = max(mxx, x); mxy = max(mxy, y); mnx = min(mnx, x); mny = min(mny, y); } int a = mnx - 1;///top int b = mny - 1;///left int c = n - mxx;///bottom int d = m - mxy;///right if (a == 0 && b == 0 && c == 0 && d == 0){ cout <<"pass"<>s; return 0; } if ((a ^ b ^ c ^ d) == 0){ cout <<"pass"<>s; if (s == "yuck!")return 0; int x; cin >>x; if (s == "top"){ a -= x; } if (s == "left"){ b -= x; } if (s == "bottom"){ c -= x; } if (s == "right"){ d -= x; } } while (a > 0 || b > 0 || c > 0 || d > 0){ int x = (a ^ b ^ c ^ d); if ((a ^ x) < a){ cout <<"top "<>s; if (s == "yuck!")return 0; cin >>x; if (s == "top"){ a -= x; } if (s == "left"){ b -= x; } if (s == "bottom"){ c -= x; } if (s == "right"){ d -= x; } } }