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