Fox Ciel is playing a game with numbers now. 

Ciel has *n* positive integers: *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*n*</sub>. She can do the following operation as many times as needed: select two different indexes *i* and *j* such that *x*<sub class="lower-index">*i*</sub> &gt; *x*<sub class="lower-index">*j*</sub> hold, and then apply assignment *x*<sub class="lower-index">*i*</sub> = *x*<sub class="lower-index">*i*</sub> - *x*<sub class="lower-index">*j*</sub>. The goal is to make the sum of all numbers as small as possible.

Please help Ciel to find this minimal sum.
The first line contains an integer *n* (2 ≤ *n* ≤ 100). Then the second line contains *n* integers: *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*n*</sub> (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ 100).
#include <bits/stdc++.h>
using namespace std;

int main(){
	int n, m, k;
		cin >> n >> m >> k;
		if (k > 4 * m * n - 2 * m - 2 * n){
			cout << "NO";
		}
		else if (m == 1){
			if (k <= n - 1){
				cout << 1;
				cout << "\n" << k << " " << "D";
			}
			else {
				cout << 2;
				cout << "\n" << n - 1 << " " << "D";
				cout << "\n" << k - n + 1 << " " << "U";
			}
		}
		else {
			cout << "YES\n";
			if (k <= m - 1){
				cout << 1 ;
				cout << "\n" << k << " " << "R";
			}
			else if (k <= 2 * m - 2){
				cout << 2;
				cout << "\n" << m - 1 << " " << "R";
				cout << "\n" << k - m + 1 << " " << "L";  
			}
			else if (k <= (2 * m - 2) + (n - 1) * (4 * m - 3)){
				int rest = k - 2 * m + 2;
				int ans = 2 + 3 * floor(rest / (4 * m - 3));
				if (rest % (4 * m - 3) == 0){;
				}
				else if (rest % (4 * m - 3) <= 3 * m - 3){
					int sub = rest % (4 * m - 3);
					if (sub >= 3){
						ans++;
					}
					sub = sub % 3;
					if (sub != 0){
						ans++;
					}
				}
				else if (rest % (4 * m - 3) <= 3 * m - 2){
					ans += 2;
				}
				else {
					ans += 3;
				}
				cout << ans;
				cout << "\n" << m - 1 << " " << "R";
				cout << "\n" << m - 1 << " " << "L";
				
				for (int i = 0; i < rest / (4 * m - 3); i++){
					cout << "\n" << m - 1 << " " << "DRU";
					cout << "\n" << 1 << " " << "D";
					cout << "\n" << m - 1 << " " << "L"; 
				}
				rest = rest % (4 * m - 3);
				if (rest == 0){
					; // +0
				}
				else if (rest <= 3 * m - 3){
					if (rest >= 3){
						cout << "\n" << rest / 3 << " " << "DRU";
					}
					rest = rest % 3;
					if (rest == 1){
						cout << "\n" << 1 << " " << "D";
					}
					else if (rest == 2){
						cout << "\n" << 1 << " " << "DR";
					}
				}
				else if (rest == 3 * m - 2){
					cout << "\n" << m - 1 << " " << "DRU";
					cout << "\n" << 1 << " " << "D";
				}
				else {
					cout << "\n" << m - 1 << " " << "DRU";
					cout << "\n" << 1 << " " << "D";
					rest -= 3 * m - 2;
					cout << "\n" << rest << " " << "L"; 
				}
			}
			else {
				int ans = 3 * n;
				cout << ans;
				cout << "\n" << m - 1 << " " << "R";
				cout << "\n" << m - 1 << " " << "L";
				for (int i = 0; i < n - 1; i++){
					cout << "\n" << m - 1 << " " << "DRU";
					cout << "\n" << 1 << " " << "D";
					cout << "\n" << m - 1 << " " << "L"; 
				}
				int rest = k - (2 * m - 2) - (n - 1) * (4 * m - 3);
				cout << "\n" << rest << " " << "U";
			}
		}
	return 0;
} 