## C - Ayoub's function

void test_case() {
ll n, k;
scanf("%lld%lld", &n, &k);
if(k == 0) {
puts("0");
return;
}
ll ans = (n + 1) * n / 2;
if(n == k) {
printf("%lld\n", ans);
return;
}
ll cn = n - k;
if(cn <= k) {
printf("%lld\n", ans - cn);
return;
}
++k;
ll m1 = cn / k;
ll m2 = m1 + 1;
ll c2 = cn % k;
ll c1 = (cn - (c2 * m2)) / m1;
//    printf("m1=%lld m2=%lld\n", m1, m2);
//    printf("c1=%lld c2=%lld\n", c1, c2);
//    printf("cn=%lld sum=%lld\n", cn, c1 * m1 + c2 * m2);
ans -= ((m1 + 1) * m1) / 2 * c1;
ans -= ((m2 + 1) * m2) / 2 * c2;
printf("%lld\n", ans);
}

## *D - Time to Run

pair<int, char> ans[3005];
int atop;

void add(int &k, int x, char c) {
if(x) {
ans[++atop] = {x, c};
k -= x;
}
}

void test_case() {
int n, m, k;
scanf("%d%d%d", &n, &m, &k);
if(k > 4 * n * m - 2 * n - 2 * m) {
puts("NO");
return;
}

atop = 0;
int y = 1;
while(k) {
add(k, min(m - 1, k), 'R');
if(y == n)
break;
add(k, min(m - 1, k), 'L');
add(k, min(1, k), 'D');
++y;
}
int x = m;
while(k) {
add(k, min(n - 1, k), 'U');
add(k, min(n - 1, k), 'D');
add(k, min(1, k), 'L');
--x;
}

puts("YES");
printf("%d\n", atop);
for(int i = 1; i <= atop; ++i)
printf("%d %c\n", ans[i].first, ans[i].second);
}