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