#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  string ans = "";
  for (int i = 1; i <= n - 1; i++) ans += "U";
  for (int i = 1; i <= m - 1; i++) ans += "L";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m - 1; j++) {
      if (i % 2 == 1)
        ans += "R";
      else
        ans += "L";
    }
    if (i != n) ans += "D";
  }
  cout << ans.size() << endl;
  cout << ans << endl;
}
