#include using namespace std; int main() { ios::sync_with_stdio(false); int cx=0,cy=0; int h,w; cin>>h>>w; int n; cin>>n; vector coms; vector place; char a; int t; for(int ctr1=0;ctr1>a>>t; coms.push_back(a); place.push_back(t); } reverse(coms.begin(),coms.end()); reverse(place.begin(),place.end()); for(int ctr1=0;ctr1