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