#include using namespace std; int main(){ int A, B; cin >> A >> B; vector S; int dx[] = {0, 0, -1, 1}; int dy[] = {-1, 1, 0, 0}; string LRUD = "LRUD"; string str; cin >> str; for(char c : str) S.push_back(LRUD.find(c)); vector> ans; int x = A, y = B; set> passed; passed.emplace(x, y); for(int k : S){ int x2 = x+dx[k], y2 = y+dy[k]; if(x2 < 0 || y2 < 0) continue; if(k%2 && !passed.count({x2, y2})){ ans.emplace_back(x2, y2); }else{ x = x2; y = y2; } } if(x == 0 && y == 0){ cout << ans.size() << endl; for(auto& p : ans) cout << p.first << " " << p.second << endl; }else{ cout << -1 << endl; } return 0; }