#include using namespace std; int main() { ios_base::sync_with_stdio(0); int r, c, k; cin >> r >> c >> k; int bot = 100000; int top = 100000; int right = 100000; int left = 100000; while (k--) { int x, y; cin >> x >> y; top = min(top, x - 1); bot = min(bot, r - x); left = min(left, y - 1); right = min(right, c - y); } int X = top ^ bot ^ left ^ right; if (X == 0) { cout << "pass" << endl; cout.flush(); string m; int ile; cin >> m; if (m[0] == 'y') return 0; cin >> ile; if (m[0] == 't') top -= ile; if (m[0] == 'b') bot -= ile; if (m[0] =='l') left -= ile; if (m[0] == 'r') right -= ile; } while (true) { X = top ^ bot ^ left ^ right; if (top >= X) { cout << "top "; top -= X; } else if (bot >= X) { cout << "bottom "; bot -= X; } else if (left >= X) { cout << "left "; left -= X; } else { cout << "right "; right -= X; } cout << X << endl; cout.flush(); string m; cin >> m; if (m[0] == 'y') return 0; int ile; cin >> ile; if (m[0] == 't') top -= ile; if (m[0] == 'b') bot -= ile; if (m[0] =='l') left -= ile; if (m[0] == 'r') right -= ile; } return 0; }