#include using namespace std; int main(){ int a, b; cin >> a >> b; string s; cin >> s; int n = s.size(); int pre = 0; string t; map type = { {'L', 1}, {'R', 1}, {'D', 2}, {'U', 2} }; for(int i = n - 1; i >= 0; i--){ if(type[s[i]] == pre) continue; t.push_back(s[i]); pre = type[s[i]]; } map flag; for(int i = 0; i < n; i++) flag[s[i]] = true; if(!flag['L'] || !flag['U']){ cout << -1 << endl; return 0; } if(t[0] == 'L'){ cout << 6 << endl; cout << 0 << " " << b+2 << endl; cout << 1 << " " << 0 << endl; cout << 1 << " " << b+1 << endl; cout << a << " " << b-1 << endl; cout << a << " " << b+1 << endl; cout << a+1 << " " << b << endl; }else if(t[0] == 'U'){ cout << 6 << endl; cout << b+2 << " " << 0 << endl; cout << 0 << " " << 1 << endl; cout << b+1 << " " << 1 << endl; cout << b-1 << " " << a << endl; cout << b << " " << a+1 << endl; cout << b+1 << " " << a << endl; }else{ if(t[1] == 'L'){ cout << 6 << endl; cout << 0 << " " << b+2 << endl; cout << 1 << " " << 0 << endl; cout << 1 << " " << b+1 << endl; cout << a << " " << b-1 << endl; cout << a << " " << b+1 << endl; cout << a+1 << " " << b << endl; }else if(t[1] == 'U'){ cout << 6 << endl; cout << b+2 << " " << 0 << endl; cout << 0 << " " << 1 << endl; cout << b+1 << " " << 1 << endl; cout << b-1 << " " << a << endl; cout << b << " " << a+1 << endl; cout << b+1 << " " << a << endl; }else{ cout << -1 << endl; } } return 0; }