#include<bits/stdc++.h>
using namespace std;
int tab[4];
int conv1(string a)
{
    if(a=="top")
        return 0;
    if(a=="bottom")
        return 1;
    if(a=="left")
        return 2;
    if(a=="right")
        return 3;
}
string conv2(int a)
{
    if(a==0)
        return "top";
    if(a==1)
        return "bottom";
    if(a==2)
        return "left";
    if(a==3)
        return "right";
}
int policz()
{
    int akt=0;
    for(int x=0;x<4;x++)
        akt^=tab[x];
    return akt;
}
int main()
{
    ios_base::sync_with_stdio(0);
    int a,b,t,c,d;
    cin>>a>>b>>t;
    tab[0]=1e6;
    tab[1]=1e6;
    tab[2]=1e6;
    tab[3]=1e6;
    while(t--)
    {
        cin>>c>>d;
        tab[0]=min(tab[0],c-1);
        tab[1]=min(tab[1],a-c);
        tab[2]=min(tab[2],d-1);
        tab[3]=min(tab[3],b-d);
    }
    int akt=policz();
    int in;
    string slowo;
    if(akt==0)
    {
        cout<<"pass"<<'\n';
        fflush(stdout);
        cin>>slowo;
    }
    else
    {
        for(int x=0;x<4;x++)
        {
            akt^=tab[x];
            if(tab[x]-akt>=0)
            {
                cout<<conv2(x)<<" "<<tab[x]-akt<<'\n';
                fflush(stdout);
                tab[x]=akt;
                akt=policz();
                cin>>slowo;
                break;
            }
            else
                akt^=tab[x];
        }

    }
    while(slowo!="yuck!")
    {
        cin>>in;
        tab[conv1(slowo)]-=in;
        akt=policz();
        for(int x=0;x<4;x++)
        {
            akt^=tab[x];
            if(tab[x]-akt>=0)
            {
                cout<<conv2(x)<<" "<<tab[x]-akt<<'\n';
                fflush(stdout);
                tab[x]=akt;
                akt=policz();
                cin>>slowo;
                break;
            }
            else
                akt^=tab[x];
        }
    }
    return 0;
}

