There was an epidemic in Monstropolis and all monsters became sick. To recover, all monsters lined up in queue for an appointment to the only doctor in the city.

Soon, monsters became hungry and began to eat each other. 

One monster can eat other monster if its weight is strictly greater than the weight of the monster being eaten, and they stand in the queue next to each other. Monsters eat each other instantly. There are no monsters which are being eaten at the same moment. After the monster *A* eats the monster *B*, the weight of the monster *A* increases by the weight of the eaten monster *B*. In result of such eating the length of the queue decreases by one, all monsters after the eaten one step forward so that there is no empty places in the queue again. A monster can eat several monsters one after another. Initially there were *n* monsters in the queue, the *i*-th of which had weight *a*<sub class="lower-index">*i*</sub>.

For example, if weights are [1, 2, 2, 2, 1, 2] (in order of queue, monsters are numbered from 1 to 6 from left to right) then some of the options are:
 1.  the first monster can't eat the second monster because *a*<sub class="lower-index">1</sub> = 1 is not greater than *a*<sub class="lower-index">2</sub> = 2; 1.  the second monster can't eat the third monster because *a*<sub class="lower-index">2</sub> = 2 is not greater than *a*<sub class="lower-index">3</sub> = 2; 1.  the second monster can't eat the fifth monster because they are not neighbors; 1.  the second monster can eat the first monster, the queue will be transformed to [3, 2, 2, 1, 2]. 
After some time, someone said a good joke and all monsters recovered. At that moment there were *k* (*k* ≤ *n*) monsters in the queue, the *j*-th of which had weight *b*<sub class="lower-index">*j*</sub>. Both sequences (*a* and *b*) contain the weights of the monsters in the order from the first to the last.

You are required to provide one of the possible orders of eating monsters which led to the current queue, or to determine that this could not happen. Assume that the doctor didn't make any appointments while monsters were eating each other.
The first line contains single integer *n* (1 ≤ *n* ≤ 500) — the number of monsters in the initial queue.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">6</sup>) — the initial weights of the monsters.

The third line contains single integer *k* (1 ≤ *k* ≤ *n*) — the number of monsters in the queue after the joke. 

The fourth line contains *k* integers *b*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">2</sub>, ..., *b*<sub class="lower-index">*k*</sub> (1 ≤ *b*<sub class="lower-index">*j*</sub> ≤ 5·10<sup class="upper-index">8</sup>) — the weights of the monsters after the joke. 

Monsters are listed in the order from the beginning of the queue to the end.
In the first example, initially there were *n* = 6 monsters, their weights are [1, 2, 2, 2, 1, 2] (in order of queue from the first monster to the last monster). The final queue should be [5, 5]. The following sequence of eatings leads to the final queue:
 -  the second monster eats the monster to the left (i.e. the first monster), queue becomes [3, 2, 2, 1, 2]; -  the first monster (note, it was the second on the previous step) eats the monster to the right (i.e. the second monster), queue becomes [5, 2, 1, 2]; -  the fourth monster eats the mosnter to the left (i.e. the third monster), queue becomes [5, 2, 3]; -  the finally, the third monster eats the monster to the left (i.e. the second monster), queue becomes [5, 5]. 
Note that for each step the output contains numbers of the monsters in their current order in the queue.
6
1 2 2 2 1 2
2
5 5
YES
2 L
1 R
4 L
3 L
5
1 2 3 4 5
1
15
YES
5 L
4 L
3 L
2 L
5
1 1 1 3 3
3
2 1 6
NO
5
1 1 1 1 2
3
1 1 4
YES
5 L
4 L
5
1 1 1 1 1
4
1 1 2 1
NO
6
2 1 2 2 1 2
2
5 5
YES
3 L
2 L
4 L
3 L
8
2 5 3 1 4 2 3 4
3
10 6 8
NO
1
959139
1
470888
NO
3
2 2 1
1
5
YES
2 R
2 L
3
1 2 2
1
5
YES
2 L
1 R
5
1 2 3 4 5
1
10
NO
5
325539 329221 106895 882089 718673
5
699009 489855 430685 939232 282330
NO
10
30518 196518 274071 359971 550121 204862 843967 173607 619138 690754
3
171337 183499 549873
NO
3
2 1 1
1
3
NO
4
2 2 2 1
3
2 2 2
NO
3
1 2 3
1
3
NO
2
1 2
2
3 1
NO
5
3 3 2 2 1
2
8 3
YES
2 R
2 L
2 R
3
3 2 5
1
10
YES
3 L
2 L
3
1 5 1
1
6
NO
5
1 2 3 4 5
3
1 2 3
NO
3
5 2 3
1
10
YES
1 R
1 R
3
2 1 3
1
6
YES
3 L
2 L
3
3 2 1
1
6
YES
1 R
1 R
2
5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 0
getsome = []
for i in range(k):
    c = 0
    for j in range(w,n):
        c+=scum[j]
        if c == bag[i]:
            hoot.append(j+1)
            w = j+1
            break
        if c>bag[i]:
            www = 1
            break
    if www == 1:
        break
    if c<bag[i]:
        www = 1
        break
if www == 1 or j<n-1:
    print("NO")
else:
    lost = 0
    for i in range(len(hoot)):
        hell = 0
        virginity = max(scum[lost:hoot[i]])
        if virginity == bag[i]:
            lost = hoot[i]
            continue
        for j in range(lost,hoot[i]):
            if scum[j] == virginity:
                if j!=lost and j!=hoot[i] - 1:
                    if scum[j] >scum[j-1] or scum[j] > scum[j+1]:
                        hell = 1
                        quirks = j
                        break
                else:
                    if j == lost:
                        if scum[j] > scum[j+1]:
                            hell = 1
                            quirks = j
                            break
                    else:
                        if scum[j] > scum[j-1]:
                            hell = 1
                            quirks = j
                            break
        if hell == 1:
            count = quirks - lost
            ghetto = hoot[i] - quirks - 1
            if scum[quirks]>scum[quirks-1]:
                for v in range(count):
                    getsome.append([(count-(v)) + i+1,"L"])
                for v in range(ghetto):
                    getsome.append([i+1,"R"])
            else:
                for v in range(ghetto):
                    getsome.append([count + i+1,"R"])
                for v in range(count):
                    getsome.append([count-(v) + i+1,"L"])
        else:
            break
        lost = hoot[i]
        
    if hell == 0:
        print("NO")
    else:
        print("YES")
        for i in getsome:
            print(i[0],i[1])
                
                    
                        
                    
            

        
        
        
