#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  cout << n * m + (n - 1) + (m - 1) << endl;
  for (int i = 0; i < (n - 1); i++) cout << "U";
  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 << "D";
  }
  return 0;
}
