Amugae has a hotel consisting of $10$ rooms. The rooms are numbered from $0$ to $9$ from left to right.

The hotel has two entrances — one from the left end, and another from the right end. When a customer arrives to the hotel through the left entrance, they are assigned to an empty room closest to the left entrance. Similarly, when a customer arrives at the hotel through the right entrance, they are assigned to an empty room closest to the right entrance.

One day, Amugae lost the room assignment list. Thankfully Amugae's memory is perfect, and he remembers all of the customers: when a customer arrived, from which entrance, and when they left the hotel. Initially the hotel was empty. Write a program that recovers the room assignment list from Amugae's memory.


-----Input-----

The first line consists of an integer $n$ ($1 \le n \le 10^5$), the number of events in Amugae's memory.

The second line consists of a string of length $n$ describing the events in chronological order. Each character represents:   'L': A customer arrives from the left entrance.  'R': A customer arrives from the right entrance.  '0', '1', ..., '9': The customer in room $x$ ($0$, $1$, ..., $9$ respectively) leaves. 

It is guaranteed that there is at least one empty room when a customer arrives, and there is a customer in the room $x$ when $x$ ($0$, $1$, ..., $9$) is given. Also, all the rooms are initially empty.


-----Output-----

In the only line, output the hotel room's assignment status, from room $0$ to room $9$. Represent an empty room as '0', and an occupied room as '1', without spaces.


-----Examples-----
Input
8
LLRL1RL1

Output
1010000011
Input
9
L0L0LLRR9

Output
1100000010


-----Note-----

In the first example, hotel room's assignment status after each action is as follows.   First of all, all rooms are empty. Assignment status is 0000000000.  L: a customer arrives to the hotel through the left entrance. Assignment status is 1000000000.  L: one more customer from the left entrance. Assignment status is 1100000000.  R: one more customer from the right entrance. Assignment status is 1100000001.  L: one more customer from the left entrance. Assignment status is 1110000001.  1: the customer in room $1$ leaves. Assignment status is 1010000001.  R: one more customer from the right entrance. Assignment status is 1010000011.  L: one more customer from the left entrance. Assignment status is 1110000011.  1: the customer in room $1$ leaves. Assignment status is 1010000011. 

So after all, hotel room's final assignment status is 1010000011.

In the second example, hotel room's assignment status after each action is as follows.   L: a customer arrives to the hotel through the left entrance. Assignment status is 1000000000.  0: the customer in room $0$ leaves. Assignment status is 0000000000.  L: a customer arrives to the hotel through the left entrance. Assignment status is 1000000000 again.  0: the customer in room $0$ leaves. Assignment status is 0000000000.  L: a customer arrives to the hotel through the left entrance. Assignment status is 1000000000.  L: one more customer from the left entrance. Assignment status is 1100000000.  R: one more customer from the right entrance. Assignment status is 1100000001.  R: one more customer from the right entrance. Assignment status is 1100000011.  9: the customer in room $9$ leaves. Assignment status is 1100000010. 

So after all, hotel room's final assignment status is 1100000010.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
s = input()

num = '0123456789'
state = [0]*(10)
for i in s:
    if i in num:
        state[int(i)] = 0
    else:
        if i=='L':
            for j in range(10):
                if state[j]==0:
                    state[j] = 1
                    break
        else:
            for j in range(9, -1, -1):
                if state[j] == 0:
                    state[j] = 1
                    break

for i in state:
    print(i, end='')
        


n = int(input())
s = input()
ot = [0] * 10
for i in s:
    if i == 'L':
        for j in range(10):
            if ot[j] == 0:
                ot[j] = 1
                break
    elif i == 'R':
        for j in range(9, -1, -1):
            if ot[j] == 0:
                ot[j] = 1
                break
    else:
        ot[int(i)] = 0
print(''.join(list(map(str, ot))))

n = int(input())
l = [0] * 10
for c in input():
    if c == 'L':
        l[l.index(0)] = 1
    elif c == 'R':
        l.reverse()
        l[l.index(0)] = 1
        l.reverse()
    else:
        l[int(c)] = 0
print(*l, sep='')

import math
# helpful:
# r,g,b=map(int,input().split()
# arr = [[0 for x in range(columns)] for y in range(rows)]

n = int(input())
string = input()

arr = [0] * 10
for i in range(len(string)):
    if(string[i] == 'L'):
        index = 0
        while(arr[index] != 0):
            index += 1
        arr[index] = 1
    elif(string[i] == 'R'):
        index = 9
        while(arr[index] != 0):
            index -= 1
        arr[index] = 1
    else:
        arr[int(string[i])] = 0

printstring = ""
for i in range(10):
    printstring += str(arr[i])
print(printstring)
        


def mp():
    return map(int, input().split())

n = int(input())
s = input()

a = [0] * 10

for i in s:
    if i == 'L':
        for j in range(10):
            if a[j] == 0:
                a[j] = 1
                break
    elif i == 'R':
        for j in range(9, -1, -1):
            if a[j] == 0:
                a[j] = 1
                break
    else:
        a[int(i)] = 0

print(''.join(map(str, a)))

n=int(input())
s=input()
ans=[0]*10
for i in range(n):
  if s[i]=='L':
    for j in range(10):
      if ans[j]==0:
        ans[j]=1
        break
  elif s[i]=='R':
    for j in range(9,-1,-1):
      if ans[j]==0:
        ans[j]=1
        break
  else:
    ans[int(s[i])]=0
print(''.join(map(str,ans)))

n = int(input())
s = input()
o = [0] * 10
for c in s:
	if c == 'L':
		for i in range(10):
			if not o[i]:
				o[i] = 1
				break
	elif c == 'R':
		for i in range(9, -1, -1):
			if not o[i]:
				o[i] = 1
				break
	else:
		o[ord(c) - ord('0')] = 0
print(''.join(map(str, o)))

a = int(input())
b = input()
ans = [0] * 10
for x in b:
    if x == 'L':
        uk = 0
        while ans[uk] == 1:
            uk += 1
        ans[uk] = 1
    elif x == 'R':
        uk = 9
        while ans[uk] == 1:
            uk -= 1
        ans[uk] = 1
    else:
        ans[int(x)] = 0
for x in ans:
    print(x, end= '')


n=int(input())
ans=[0]*10
s=input()
for i in range(len(s)):
    if s[i]=="L":
        f=0
        while ans[f]!=0:
            f+=1
        ans[f]=1
    elif s[i]=="R":
        f=9
        while ans[f]!=0:
            f-=1
        ans[f]=1
    else:
        ans[int(s[i])]=0
for i in range(10):
    print(ans[i],end='')

'''input
9
L0L0LLRR9

'''
import sys
from collections import defaultdict as dd
from itertools import  permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from  heapq import heappush as hpush
from heapq import heappop as hpop
mod=10**9+7

def ri(flag=0):
	if flag==0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())

n= ri(1)

b = input()

ans =[0 for i in range(10)]

for i in b:
	if i=="L":
		for i in range(10):
			if ans[i]==0:
				ans[i]=1
				break
	elif i=="R":
		for i in range(9,-1,-1):
			if ans[i]==0:
				ans[i]=1
				break
	else:
		temp=int(i)
		ans[temp]=0

print("".join([str(i) for i in ans]))



import sys

n = int(input())
s = input()
state = [0] * 10
for c in s:
    if c == 'L':
        i = 0
        while state[i] == 1:
            i += 1
        state[i] = 1
    elif c == 'R':
        i = 9
        while state[i] == 1:
            i -= 1
        state[i] = 1
    else:
        i = int(c)
        state[i] = 0
print(''.join(map(str, state)))


from sys import stdin
n=int(stdin.readline().strip())

s=stdin.readline().strip()
arr=[0 for i in range(10)]
for  i in range(n):
    if s[i]=="L":
        for j in range(10):
            if arr[j]==0:
                arr[j]=1
                break
    elif s[i]=="R":
        for j in range(9,-1,-1):
            if arr[j]==0:
                arr[j]=1
                break
    else:
        arr[int(s[i])]=0

                
for i in arr:
    print(i,end="")


n = int(input())
s = input()

a = [0] * 10
for i in s:
    if i == 'L':
        for j in range(10):
            if a[j] == 0:
                a[j] = 1
                break
    elif i == 'R':
        for j in range(9, -1, -1):
            if a[j] == 0:
                a[j] = 1
                break
    else:
        a[int(i)] = 0

for i in a:
    print(i, end = '')


n = int(input())
s = input()
a = [0 for i in range(10)]
for i in range(n):
    if s[i] == "L":
        i = 0
        while i < len(a) and a[i] == 1:
            i += 1
        a[i] = 1
    elif s[i] == "R":
        i = len(a) - 1
        while i > -1 and a[i] == 1:
            i -= 1
        a[i] = 1
    else:
        a[int(s[i])] = 0
print(*a, sep="")

# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
# TAIWAN NUMBER ONE!!!!!!!!!!!!!!!!!!!
from sys import stdin, stdout
import math

N = int(input())
s = input()
#N,M = [int(x) for x in stdin.readline().split()]
#arr = [int(x) for x in stdin.readline().split()]

room = [0]*10

for i in range(N):
    letter = s[i]
    
    if letter=='L':
        for j in range(10):
            if room[j]==0:
                room[j] = 1
                break
    elif letter=='R':
        for j in range(9,-1,-1):
            if room[j]==0:
                room[j] = 1
                break
            
    else:
        d = int(letter)
        room[d] = 0
        
print(*room,sep='')

n = int(input())
s = input().strip()
r = [0] * 10
for c in s:
    if c == 'L':
        for i in range(10):
            if not r[i]:
                r[i] = 1
                break
    elif c == 'R':
        for i in range(9, -1, -1):
            if not r[i]:
                r[i] = 1
                break
    else:
        r[int(c)] = 0
print(''.join(str(x) for x in r))

#578_A

n = int(input())

l = list(input())

a = [0] * 10

for i in l:
    if i == "L":
        j = 0
        while a[j] != 0:
            j += 1
        a[j] = 1
    elif i == "R":
        j = 9
        while a[j] != 0:
            j -= 1
        a[j] = 1
    else:
        a[int(i)] = 0

print("".join([str(i) for i in a]))


n = int(input())

o = input()
k = [False] * 10

for c in o:
    if c.isdigit():
        k[int(c)] = 0
    elif c == 'L':
        for i in range(10):
            if not k[i]:
                k[i] = True
                break
    else:
        for i in range(9, -1, -1):
            if not k[i]:
                k[i] = True
                break
print(''.join(map(str, map(int, k))))

n = int(input())
s = input()

vals = [0] * 10
for c in s:
	if c=="L":
		free = vals.index(0)
		vals[free] = 1
	elif c=="R":
		free = 9 - vals[::-1].index(0)
		vals[free] = 1
	else:
		cleared = int(c)
		vals[cleared] = 0

print("".join(map(str,vals)))

n = int(input())
s = input()
r = ['0'] * 10

for i in s:
	if i == 'L':
		for j in range(10):
			if r[j] == '0':
				r[j] = '1'
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if r[j] == '0':
				r[j] = '1'
				break
	else:
		r[int(i)] = '0'

print(''.join(r))

N = int(input())
S = input()

rooms = [0] * 10
for c in S:
    if c == 'L':
        i = 0
        while rooms[i]:
            i += 1
        rooms[i] = 1
    elif c == 'R':
        i = 9
        while rooms[i]:
            i -= 1
        rooms[i] = 1
    else:
        rooms[int(c)] = 0

print(''.join(map(str,rooms)))


n=int(input())
s=input()
a=[0]*10
for i in s:
    if i=='L':
        for j in range(10):
            if a[j]==0:
                a[j]=1
                break
    elif i=='R':
        for j in range(10):
            if a[-j-1]==0:
                a[-j-1]=1
                break
    else:
        k=int(i)
        a[k]=0
for i in range(10):
    print(a[i],end="")
    

n = int(input())
D = [0] * 10
S = input()
for i in range(len(S)):
    if S[i] in ['L', 'R']:
        if S[i] == 'L':
            for j in range(10):
                if D[j] == 0:
                    D[j] = 1
                    break
        else:
            for j in range(9, -1, -1):
                if D[j] == 0:
                    D[j] = 1
                    break
    else:
        k = int(S[i])
        D[k] = 0

print(''.join(map(str, D)))

n = int(input())
u = list(input())
d = [0] * 10
for i in range(n):
    if u[i] == 'L':
        for j in range(10):
            if d[j] == 0:
                d[j] = 1
                break
    elif u[i] == 'R':
        for j in range(9, -1, -1):
            if d[j] == 0:
                d[j] = 1
                break
    else:
        d[int(u[i])] = 0
print(''.join(map(str, d)))