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: EASY

Solutions:
input()
a = ['0'] * 10
for ch in input():
	if ch == 'L':
		i = 0
		while a[i] != '0':
			i += 1
		a[i] = '1'
	elif ch == 'R':
		i = 9
		while a[i] != '0':
			i -= 1
		a[i] = '1'
	else:
		a[int(ch)] = '0'
print(''.join(a))


n = int(input())
l = 0
r = 9
stat = [0] * 10
a = input().strip()
for i in range(0, n):
	if a[i] == 'L':
		stat[l] = 1
		l = 0
		while stat[l] == 1:
			l += 1
			if l == 10:
				break
		r = 9
		while stat[r] == 1:
			r -= 1
			if r == -1:
				break
	elif a[i] == 'R':
		stat[r] = 1
		r = 9
		while stat[r] == 1:
			r -= 1
			if r == -1:
				break
		l = 0
		while stat[l] == 1:
			l += 1
			if l == 10:
				break
	else:
		stat[int(a[i])] = 0
		if int(a[i]) < l:
			l = int(a[i])
		if int(a[i]) > r:
			r = int(a[i])
for i in stat:
	print(i, end='')
print()


input()
A = [0] * 10
for x in input():
	if x == 'L':
		A[A.index(0)] = 1
	elif x == 'R':
		i = 9
		while A[i]:
			i -= 1
		A[i] = 1
	else:
		A[int(x)] = 0
print(*A, sep='')


n = int(input())
l = list('0000000000')
st = list(input())
for i in st:
	if i == 'L':
		for j in range(10):
			if l[j] == '0':
				l[j] = '1'
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if l[j] == '0':
				l[j] = '1'
				break
	else:
		l[int(i)] = '0'
print(*l, sep='')


n = int(input())
memory = input()
room_state = ['0'] * 10
empty = [x for x in range(10)]
for state in memory:
	if state == 'L':
		room = min(empty)
		room_state[room] = '1'
		empty.remove(room)
	elif state == 'R':
		room = max(empty)
		room_state[room] = '1'
		empty.remove(room)
	else:
		empty.append(int(state))
		room_state[int(state)] = '0'
print(''.join(room_state))


def roomStatus(s):
	rooms = [0] * 10
	for op in s:
		if op == 'L':
			i = 0
			while rooms[i] != 0:
				i += 1
			rooms[i] = 1
		elif op == 'R':
			i = 9
			while rooms[i] != 0:
				i -= 1
			rooms[i] = 1
		else:
			rooms[int(op)] = 0
	return ''.join(list(map(str, rooms)))
n = int(input())
s = input()
print(roomStatus(s))


gi = lambda : list(map(int, input().split()))
occ = [0] * 10
(n,) = gi()
s = input()
for e in s:
	if e == 'L':
		occ[occ.index(0)] = 1
	elif e == 'R':
		occ[-occ[::-1].index(0) - 1] = 1
	else:
		occ[int(e)] = 0
print(''.join(map(str, occ)))


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


input()
a = [0] * 10
z = [*range(10)]
for i in input():
	if i == 'L':
		e = min(z)
		a[e] = 1
		z.remove(e)
	elif i == 'R':
		e = max(z)
		a[e] = 1
		z.remove(e)
	else:
		e = int(i)
		a[e] = 0
		z += [e]
print(*a, sep='')


n = int(input())
s = str(input())
a = ['0'] * 10
c = 0
d = 9
for i in range(n):
	if s[i] == 'L':
		c = a.index('0')
		a[c] = '1'
	elif s[i] == 'R':
		b = a[::-1]
		e = b.index('0')
		a[d - e] = '1'
	else:
		a[int(s[i])] = '0'
		c = a.index('0')
print(''.join(a))


n = int(input())
s = input()
p = '0000000000'
A = list(p)
for i in s:
	if i == 'L':
		Ind = A.index('0')
		A[Ind] = '1'
	elif i == 'R':
		B = A[::-1]
		Ind = 9 - B.index('0')
		A[Ind] = '1'
	else:
		A[int(i)] = '0'
print(''.join(A))


import sys
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right
import math
n = int(input())
s = input()
x = dc(int)
for i in s:
	if i == 'L':
		for j in range(10):
			if x[j] == 0:
				x[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if x[j] == 0:
				x[j] = 1
				break
	else:
		x[int(i)] = 0
for i in range(10):
	x[i] = str(x[i])
for i in range(9):
	print(x[i], end='')
print(x[9])


a = int(input())
b = input()
c = [0] * 10
for x in range(a):
	if b[x] == 'L':
		for y in range(10):
			if c[y] == 0:
				c[y] = 1
				break
	elif b[x] == 'R':
		for y in range(9, -1, -1):
			if c[y] == 0:
				c[y] = 1
				break
	else:
		d = int(b[x])
		c[d] = 0
for x in c:
	print(x, end='')


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


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


n = int(input())
l = list(input())
t = [0] * 10
for x in range(n):
	if l[x] == 'L':
		for i in range(10):
			if t[i] == 0:
				t[i] = 1
				break
	elif l[x] == 'R':
		for j in range(9, -1, -1):
			if t[j] == 0:
				t[j] = 1
				break
	else:
		t[int(l[x])] = 0
print(*t, sep='')


import sys, math, queue
MOD = 998244353
sys.setrecursionlimit(1000000)
n = int(input())
s = input()
x = ['0' for i in range(10)]
for si in s:
	if si == 'L':
		i = 0
		while x[i] != '0':
			i += 1
		x[i] = '1'
	elif si == 'R':
		i = 9
		while x[i] != '0':
			i -= 1
		x[i] = '1'
	else:
		x[int(si)] = '0'
print(''.join(x))


b = int(input())
c = input()
sp = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(0, len(c)):
	if c[i] == 'L':
		for j in range(0, len(sp)):
			if sp[j] == 0:
				sp[j] = 1
				break
	elif c[i] == 'R':
		for j in range(len(sp) - 1, -1, -1):
			if sp[j] == 0:
				sp[j] = 1
				break
	else:
		sp[int(c[i])] = 0
print(*sp, sep='')


n = int(input())
e = input()
r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in e:
	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
for j in r:
	print(j, end='')


n = int(input())
rooms = [0] * 10
events = input()
for ev in events:
	if ev == 'L':
		cur = 0
		while cur < len(rooms):
			if rooms[cur] == 0:
				break
			cur += 1
		rooms[cur] = 1
	elif ev == 'R':
		cur = len(rooms) - 1
		while cur >= 0:
			if rooms[cur] == 0:
				break
			cur -= 1
		rooms[cur] = 1
	else:
		ev = int(ev)
		rooms[ev] = 0
print(''.join((str(r) for r in rooms)))


n = int(input())
s = input()
r = ['0'] * 10
for i in range(n):
	c = s[i]
	if c == 'L':
		l_idx = 0
		while l_idx < 10 and r[l_idx] == '1':
			l_idx += 1
		r[l_idx] = '1'
	elif c == 'R':
		r_idx = 9
		while r_idx >= 0 and r[r_idx] == '1':
			r_idx -= 1
		r[r_idx] = '1'
	else:
		r[int(c)] = '0'
print(''.join(r))


def started_from_left(array):
	for i in range(0, 10):
		if array[i] == 0:
			array[i] = 1
			break
	return array

def started_from_right(array):
	for i in range(9, -1, -1):
		if array[i] == 0:
			array[i] = 1
			break
	return array

def goa_trip(length, string):
	temp = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
	count = 0
	for element in string:
		if element == 'L':
			temp = started_from_left(temp)
		elif element == 'R':
			temp = started_from_right(temp)
		else:
			temp[int(element)] = 0
	[print(element, end='') for element in temp]
length = int(input())
string = input()
goa_trip(length, string)


n = int(input())
s = input()
ans = [0 for _ in range(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 reversed(range(10)):
			if ans[j] == 0:
				ans[j] = 1
				break
	else:
		ans[int(s[i])] = 0
print(''.join(map(str, ans)))


def main():
	n = int(input())
	s = input().strip()
	room = ['0' for _ in range(10)]
	for _s in s:
		if _s == 'L':
			for j in range(10):
				if room[j] == '0':
					room[j] = '1'
					break
		elif _s == 'R':
			for j in range(9, -1, -1):
				if room[j] == '0':
					room[j] = '1'
					break
		else:
			i = int(_s)
			room[i] = '0'
	print(''.join(room))
main()


input()
a = [0] * 10
for c in input():
	if c == 'L':
		a[a.index(0)] = 1
	elif c == 'R':
		a[9 - a[::-1].index(0)] = 1
	else:
		a[ord(c) - ord('0')] = 0
print(*a, sep='')


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


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


m = '0000000000'
m = list(m)

def house(c):
	if c == 'L':
		for i in range(10):
			if m[i] == '0':
				m[i] = '1'
				break
	else:
		for i in range(10):
			if m[9 - i] == '0':
				m[9 - i] = '1'
				break

def proc(c):
	if c == 'L':
		house('L')
	elif c == 'R':
		house('R')
	else:
		m[int(c)] = '0'
n = int(input())
s = input()
for i in range(n):
	proc(s[i])
print(''.join(m))


n = input()
string = input()
rooms = [0 for x in range(10)]

def left(rooms):
	i = 0
	while rooms[i] != 0:
		i += 1
	rooms[i] = 1

def right(rooms):
	i = 9
	while rooms[i] != 0:
		i -= 1
	rooms[i] = 1
x = 0
while True:
	try:
		if string[x] == 'L':
			left(rooms)
		elif string[x] == 'R':
			right(rooms)
		else:
			rooms[int(string[x])] = 0
		x += 1
	except Exception:
		break
for num in rooms:
	print(num, end='')


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='')


n = int(input())
s = input()
x = list('0000000000')
for i in s:
	if i == 'L':
		x[''.join(x).find('0')] = '1'
	elif i == 'R':
		x[''.join(x).rfind('0')] = '1'
	else:
		x[int(i)] = '0'
print(''.join(x))


n = int(input())
lst = list(input())
hotel = [0 for i in range(10)]
for i in range(n):
	if lst[i] == 'L':
		curl = hotel.index(0)
		hotel[curl] = 1
	elif lst[i] == 'R':
		curr = hotel[::-1].index(0)
		hotel[9 - curr] = 1
	else:
		hotel[int(lst[i])] = 0
print(*hotel, sep='')


def rooms(s):
	ds = ['0'] * 10
	for i in s:
		if i.isdigit():
			ds[int(i)] = '0'
		elif i == 'L':
			ind = ds.index('0')
			ds[ind] = '1'
		elif i == 'R':
			l_ind = len(ds) - ds[::-1].index('0') - 1
			ds[l_ind] = '1'
	return ''.join(ds)
n = int(input())
s = input()
print(rooms(s))


(eventCount, eventsRecalled) = (int(input()), input())
roomOccupancy = set(list('0123456789'))
for event in eventsRecalled:
	if event == 'L':
		roomOccupancy.remove(min(roomOccupancy))
	elif event == 'R':
		roomOccupancy.remove(max(roomOccupancy))
	else:
		roomOccupancy.add(event)
verdict = ''
for roomNumber in '0123456789':
	if roomNumber in roomOccupancy:
		verdict += '0'
	else:
		verdict += '1'
print(verdict)


temp = input()
n = input()
one = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in n:
	if i == 'L':
		s = one.index(0)
		one[s] = 1
	elif i == 'R':
		one.reverse()
		s = one.index(0)
		one[s] = 1
		one.reverse()
	elif i.isdigit():
		i = int(i)
		one[i] = 0
for i in one:
	print(i, end='')


n = int(input())
l = input()
k = [0 for i in range(10)]
for i in l:
	if i == 'L':
		z = 0
		while k[z] == 1:
			z += 1
		k[z] = 1
	elif i == 'R':
		z = 9
		while k[z] == 1:
			z -= 1
		k[z] = 1
	else:
		k[int(i)] = 0
print(*k, sep='')


n = int(input())
command = input()

def work(n, command):
	rooms = [0] * 10
	for x in range(n):
		if command[x] == 'L':
			for i in range(n):
				if rooms[i] == 0:
					rooms[i] = 1
					break
		elif command[x] == 'R':
			for i in range(n):
				if rooms[len(rooms) - 1 - i] == 0:
					rooms[len(rooms) - 1 - i] = 1
					break
		else:
			rooms[int(command[x])] = 0
	res = ''
	for x in range(10):
		res += str(rooms[x])
	print(res)
work(n, command)


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


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


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


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


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


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


a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
n = int(input())
s = str(input())
for i in range(0, n):
	if s[i] == 'L':
		for j in range(0, 10):
			if a[j] == 0:
				a[j] = 1
				break
	if s[i] == 'R':
		for j in range(9, -1, -1):
			if a[j] == 0:
				a[j] = 1
				break
	if s[i] != 'L':
		if s[i] != 'R':
			for j in range(0, 10):
				if j == int(s[i]):
					a[j] = 0
					break
for i in range(0, 10):
	print(a[i], end='')


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


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


import sys
import math as mt
t = 1
for __ in range(t):
	n = int(input())
	s = input()
	l = [0] * 10
	for i in range(n):
		if s[i] == 'L':
			for j in range(10):
				if l[j] == 0:
					l[j] = 1
					break
		elif s[i] == 'R':
			for j in range(9, -1, -1):
				if l[j] == 0:
					l[j] = 1
					break
		else:
			l[int(s[i])] = 0
	print(*l, sep='')


input()
a = input()
rooms = []
for i in range(0, 10):
	rooms.append('0')
for i in range(0, len(a)):
	if a[i] == 'L':
		for j in range(0, 10):
			if rooms[j] == '0':
				rooms[j] = '1'
				break
	elif a[i] == 'R':
		k = 9
		while k != -1:
			if rooms[k] == '0':
				rooms[k] = '1'
				break
			k = k - 1
	else:
		rooms[int(a[i])] = '0'
print(''.join(rooms))


n = int(input())
S = input()
X = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for s in S:
	if s == 'L':
		for i in range(0, 10):
			if X[i] == 0:
				X[i] = 1
				break
	elif s == 'R':
		for i in reversed(range(0, 10)):
			if X[i] == 0:
				X[i] = 1
				break
	else:
		X[int(s)] = 0
for x in X:
	print(x, end='')
print('')


n = int(input())
s = input()
l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(n):
	if s[i] == 'L':
		l.pop(0)
	elif s[i] == 'R':
		l.pop(len(l) - 1)
	else:
		l.insert(0, int(s[i]))
		l.sort()
d = ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1']
for i in l:
	d[i] = '0'
print(''.join(d))


chekhel = input()
vorodi = list(input())
rooms = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for harf in vorodi:
	if harf == 'L':
		for i in range(len(rooms)):
			if rooms[i] != 1:
				rooms[i] = 1
				break
	elif harf == 'R':
		for i in range(len(rooms)):
			if rooms[len(rooms) - i - 1] != 1:
				rooms[len(rooms) - i - 1] = 1
				break
	else:
		rooms[int(harf)] = 0
print(''.join(map(str, rooms)))


n = int(input())
s = input()
arr = [0] * 10
left = 0
right = 0
for x in s:
	if x == 'L':
		i = 0
		while arr[i] != 0 and i < 9:
			i += 1
		arr[i] = 1
	elif x == 'R':
		j = 9
		while arr[j] and j >= 0:
			j -= 1
		arr[j] = 1
	else:
		arr[int(x)] = 0
for y in arr:
	print(y, end='')


def sol():
	n = int(input())
	A = input()
	B = [0] * 10
	(lc, rc) = (0, 9)
	for c in A:
		if c == 'L':
			lc = 0
			while lc <= 9 and B[lc] != 0:
				lc += 1
			B[lc] = 1
		elif c == 'R':
			rc = 9
			while lc >= 0 and B[rc] != 0:
				rc -= 1
			B[rc] = 1
		else:
			p = int(c)
			B[p] = 0
	print(*B, sep='')
sol()


n = int(input())
c = input()
m = ['0'] * 10
pointer_left = 0
pointer_right = 9
for i in range(n):
	if c[i] == 'L':
		for j in range(10):
			if m[j] == '0':
				m[j] = '1'
				break
	elif c[i] == 'R':
		for j in range(9, -1, -1):
			if m[j] == '0':
				m[j] = '1'
				break
	else:
		m[int(c[i])] = '0'
print(''.join(m))


n = int(input())
s = input()
rooms = [0] * 10
for i in range(n):
	if s[i] == 'L':
		for j in range(0, 10):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	else:
		x = int(s[i])
		rooms[x] = 0
print(*rooms, sep='')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		s = S()
		r = [0] * 10
		for c in s:
			if c == 'L':
				for i in range(10):
					if r[i] == 0:
						r[i] = 1
						break
			elif c == 'R':
				for i in range(9, -1, -1):
					if r[i] == 0:
						r[i] = 1
						break
			else:
				r[int(c)] = 0
		rr.append(JA(r, ''))
	return JA(rr, '\n')
print(main())


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
from fractions import Fraction

def ii():
	return int(input())

def si():
	return str(input())

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

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s
n = ii()
s = si()
l = [0] * 10
for i in range(n):
	if s[i] == 'L':
		for j in range(10):
			if l[j] == 0:
				l[j] = 1
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if l[j] == 0:
				l[j] = 1
				break
	else:
		l[int(s[i])] = 0
print(''.join(map(str, l)))


n = input()
order = input()
hotel = [False for i in range(10)]
for i in order:
	if i == 'L':
		for j in range(10):
			if not hotel[j]:
				hotel[j] = True
				break
	if i == 'R':
		for j in range(9, -1, -1):
			if not hotel[j]:
				hotel[j] = True
				break
	if ord('0') <= ord(i) and ord('9') >= ord(i):
		hotel[int(i)] = False
hotel = ['1' if i else '0' for i in hotel]
print(''.join(hotel))


def si():
	return input()
n = int(input())
s = si()
r = [0] * 10
for i in range(n):
	if s[i] == 'L':
		for j in range(10):
			if r[j] == 0:
				r[j] = 1
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if r[j] == 0:
				r[j] = 1
				break
	else:
		ch = int(s[i])
		r[ch] = 0
for i in r:
	print(i, end='')
print()


n = int(input())
room_status = [0] * 10
checkins = input()
for i in range(n):
	what_now = checkins[i]
	if what_now == 'L':
		for j in range(10):
			if room_status[j] == 0:
				room_status[j] = 1
				break
	elif what_now == 'R':
		for j in range(9, -1, -1):
			if room_status[j] == 0:
				room_status[j] = 1
				break
	else:
		room_status[int(what_now)] = 0
ans = ''
for i in range(10):
	ans += str(room_status[i])
print(ans)


number = input()
events = input()
output = ['0'] * 10
for event in events:
	if event == 'L':
		left_index = output.index('0')
		output[left_index] = '1'
	elif event == 'R':
		right_index = 9 - output[::-1].index('0')
		output[right_index] = '1'
	else:
		index = int(event)
		output[index] = '0'
print(*output, sep='')


N = int(input())
ER = [1] * 10
for s in input().strip():
	if s == 'L':
		ER[min((i for i in range(10) if ER[i]))] = 0
	elif s == 'R':
		ER[max((i for i in range(10) if ER[i]))] = 0
	else:
		ER[int(s)] = 1
print(''.join(map(lambda x: str(int(not x)), ER)))


n = int(input())
a = list(input())
m = []
for i in range(0, 10):
	m.append('0')
for i in range(0, n):
	if a[i] == 'L':
		x = m.index('0')
		m[x] = '1'
	elif a[i] == 'R':
		m.reverse()
		x = m.index('0')
		m[x] = '1'
		m.reverse()
	elif 0 <= int(a[i]) <= n:
		m[int(a[i])] = '0'
for k in range(0, 10):
	print(m[k], end='')


n = int(input())
a = input()
b = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for x in a:
	if x == 'L':
		i = 0
		for y in b:
			if y == 0:
				b[i] = 1
				break
			i += 1
	elif x == 'R':
		i = 9
		while i >= 0:
			if b[i] == 0:
				b[i] = 1
				break
			i -= 1
	else:
		b[int(x)] = 0
for x in b:
	print(x, end='')


n = int(input())
p = str(input())
comnaty = [0 for i in range(10)]
for i in p:
	if i == 'L':
		for z in range(n):
			if comnaty[z] == 0:
				comnaty[z] = 1
				break
	elif i == 'R':
		for z in range(9, -1, -1):
			if comnaty[z] == 0:
				comnaty[z] = 1
				break
	else:
		comnaty[int(i)] = 0
str1 = ''.join(map(str, comnaty))
print(str1)


n = int(input())
strin = input()
arr = [0] * 10
for i in strin:
	if i == 'L':
		j = 0
		while arr[j] == 1:
			j += 1
		arr[j] = 1
	elif i == 'R':
		j = len(arr) - 1
		while arr[j] == 1:
			j -= 1
		arr[j] = 1
	else:
		arr[int(i)] = 0
print(''.join([str(x) for x in arr]))


n = int(input())
a = input()
result = [0] * 10

def L():
	j = 0
	while result[j] == 1:
		j += 1
	result[j] += 1
	return result

def R():
	j = 1
	while result[-j] == 1:
		j += 1
	result[-j] += 1
	return result
for i in range(n):
	if a[i] == 'L':
		L()
	elif a[i] == 'R':
		R()
	elif a[i] == '0':
		result[0] -= 1
	elif a[i] == '1':
		result[1] -= 1
	elif a[i] == '2':
		result[2] -= 1
	elif a[i] == '3':
		result[3] -= 1
	elif a[i] == '4':
		result[4] -= 1
	elif a[i] == '5':
		result[5] -= 1
	elif a[i] == '6':
		result[6] -= 1
	elif a[i] == '7':
		result[7] -= 1
	elif a[i] == '8':
		result[8] -= 1
	elif a[i] == '9':
		result[9] -= 1
print(''.join(map(str, result)))


N = int(input())
listi = 10 * [0]
Procedure = input()
for s in Procedure:
	if s == 'L':
		for i in range(len(listi)):
			if listi[i] == 0:
				listi[i] = 1
				break
	elif s == 'R':
		for i in range(len(listi) - 1, -1, -1):
			if listi[i] == 0:
				listi[i] = 1
				break
	else:
		listi[int(s)] = 0
for i in listi:
	print(i, end='')


from sys import stdin

def main():
	N = int(input())
	S = input()
	ans = ['0'] * 10
	for s in S:
		if s == 'L':
			i = ans.index('0')
			ans[i] = '1'
		elif s == 'R':
			ans = ans[::-1]
			i = ans.index('0')
			ans[i] = '1'
			ans = ans[::-1]
		else:
			ans[int(s)] = '0'
	print(''.join(ans))
input = lambda : stdin.readline().rstrip()
main()


import sys
import os

def changeStdioToFile():
	path = os.path.dirname(os.path.abspath(__file__))
	sys.stdin = open(f'{path}/input.txt', 'r')
	sys.stdout = open(f'{path}/output.txt', 'w')
t = 1
for _ in range(t):
	n = int(input())
	orders = input()
	rooms = ['0'] * 10
	for c in orders:
		if c == 'L':
			rooms[rooms.index('0')] = '1'
		elif c == 'R':
			rooms[9 - rooms[::-1].index('0')] = '1'
		else:
			rooms[int(c)] = '0'
	print(''.join(rooms))


def get_last_arrangement(seq):
	rooms = [0 for _ in list(range(10))]
	for e in seq:
		if e == 'L':
			for i in range(10):
				if rooms[i] == 0:
					rooms[i] = 1
					break
		elif e == 'R':
			for i in range(10):
				if rooms[9 - i] == 0:
					rooms[9 - i] = 1
					break
		else:
			rooms[int(e)] = 0
	return ''.join([str(r) for r in rooms])
input()
print(get_last_arrangement(input()))


n = int(input())
s = input().strip()
arr = [0 for i in range(10)]
for i in s:
	if i == 'L':
		index = arr.index(0)
		arr[index] = 1
	elif i == 'R':
		index = arr[::-1].index(0)
		arr[9 - index] = 1
	else:
		arr[int(i)] = 0
for i in arr:
	print(i, end='')
print('')


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

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

def getArr():
	return list(map(int, input().split()))

def getStr():
	return input().strip()

def getMinIndex(a):
	m = min(a)
	return a.index(m)

def getMaxIndex(a):
	m = max(a)
	return a.index(m)
N = getInt()
S = getStr()
A = list(range(10))
for i in range(N):
	if S[i] == 'L':
		A.pop(getMinIndex(A))
	elif S[i] == 'R':
		A.pop(getMaxIndex(A))
	else:
		room = int(S[i])
		A.append(room)
for i in range(10):
	if i in A:
		print('0', end='')
	else:
		print('1', end='')


N = int(input())
S = input()
List = [0] * 10
for i in range(N):
	if S[i] == 'L':
		for i in range(10):
			if List[i] == 0:
				List[i] = 1
				break
	elif S[i] == 'R':
		for i in range(9, -1, -1):
			if List[i] == 0:
				List[i] = 1
				break
	else:
		List[int(S[i])] = 0
Ans = ''
for i in range(10):
	Ans += str(List[i])
print(Ans)


n = int(input())
d = input()
rooms = ['0'] * 10
for i in range(n):
	if d[i] == 'L':
		k = rooms.index('0')
		rooms[k] = '1'
	elif d[i] == 'R':
		j = rooms[::-1].index('0')
		rooms[9 - j] = '1'
	else:
		rooms[int(d[i])] = '0'
print(''.join(rooms))


room = [0] * 10
n = int(input())
string = input()
for i in string:
	if i == 'L':
		room[room.index(0)] = 1
	elif i == 'R':
		room[-room[::-1].index(0) - 1] = 1
	else:
		room[int(i)] = 0
print(''.join(map(str, room)))


n = int(input())
r = lambda : map(str, input().split())
arr1 = [*r()]
arr = [0] * 10
for i in range(0, n):
	if arr1[0][i] == 'L':
		for j in range(0, 10):
			if arr[j] == 0:
				del arr[j]
				arr.insert(j, 1)
				break
	elif arr1[0][i] == 'R':
		for j in range(9, -1, -1):
			if arr[j] == 0:
				del arr[j]
				arr.insert(j, 1)
				break
	elif arr1[0][i].isdigit():
		del arr[int(arr1[0][i])]
		arr.insert(int(arr1[0][i]), 0)
print(*arr, sep='')


n = int(input())
s = input()
room = [0] * 10
ss = ''
left = []
right = []
for i in s:
	if i == 'L':
		for j in range(0, 10):
			if room[j] == 0:
				room[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if room[j] == 0:
				room[j] = 1
				break
	else:
		room[int(i)] = 0
for i in room:
	ss += str(i)
print(ss)


no_events = input()
no_events = int(no_events)
events = input()
events = list(events)
s = list('0000000000')
for j in events:
	if j == 'R':
		i = 9
		while i >= 0:
			if s[i] == '0':
				s[i] = '1'
				break
			i = i - 1
	elif j == 'L':
		i = 0
		while i < 10:
			if s[i] == '0':
				s[i] = '1'
				break
			i = i + 1
	else:
		s[int(j)] = '0'
s = ''.join(s)
print(s)


def left(ans):
	ans[ans.index(0)] = 1
	return ans

def right(ans, n):
	ans[n - ans[::-1].index(0) - 1] = 1
	return ans

def remove(ans, i):
	ans[i] = 0
	return ans
n = int(input())
arr = input()
n = 10
ans = [0] * n
for i in arr:
	if i == 'L':
		ans = left(ans)
	elif i == 'R':
		ans = right(ans, n)
	else:
		ans = remove(ans, int(i))
print(*ans, sep='')


n = int(input())
s = input()
lst = list(s)
res = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
for i in lst:
	if i == 'L':
		pos = res.index('0')
		res[pos] = '1'
	elif i == 'R':
		pos = ''.join(res).rindex('0')
		res[pos] = '1'
	else:
		i = int(i)
		res[i] = '0'
print(''.join(res))


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


rooms = [None] * 10
n = int(input())
s = input()

def find_from_left():
	for i in range(10):
		if rooms[i] == None:
			return i
	return None

def find_from_right():
	for i in range(9, -1, -1):
		if rooms[i] == None:
			return i
	return None
for e in s:
	if e == 'L':
		room_no = find_from_left()
		rooms[room_no] = e
	elif e == 'R':
		room_no = find_from_right()
		rooms[room_no] = e
	else:
		room_no = int(e)
		rooms[room_no] = None
print(''.join(map(lambda x: '0' if x is None else '1', rooms)))


n = int(input())
st = input()
arr = [0] * 10
for ch in st:
	if ch == 'L':
		for e in range(10):
			if arr[e] == 0:
				arr[e] = 1
				break
	elif ch == 'R':
		for e in range(9, -1, -1):
			if arr[e] == 0:
				arr[e] = 1
				break
	else:
		arr[int(ch)] = 0
for e in arr:
	print(e, end='')


n = int(input())
s = input()
num = '0123456789'
state = [0] * 10
for i in s:
	if i in num:
		state[int(i)] = 0
	elif 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 = input()
s = input()
k = ['0'] * 10
for i in range(len(s)):
	if s[i] == 'L':
		for j in range(10):
			if k[j] == '0':
				k[j] = '1'
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if k[j] == '0':
				k[j] = '1'
				break
	else:
		k[int(s[i])] = '0'
print(''.join(k))


from sys import stdin
n = int(stdin.readline().strip())
s = stdin.readline().strip()
rooms = [0 for x in range(0, 10)]
for c in s:
	if c == 'L':
		for i in range(0, 10):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	elif c == 'R':
		for i in reversed(range(0, 10)):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	else:
		rooms[int(c)] = 0
for idx in range(len(rooms)):
	print(rooms[idx], end='')
print()


n = int(input())
l = [0] * 10
a = input()
for i in range(len(a)):
	if a[i] == 'L':
		j = 0
		while l[j] != 0:
			j = j + 1
		l[j] += 1
	elif a[i] == 'R':
		k = 9
		while l[k] != 0:
			k = k - 1
		l[k] = l[k] + 1
	else:
		l[int(a[i])] -= 1
print(*l, sep='')


N = int(input())
string = input()
output = [0] * 10
for i in string:
	if i == 'L':
		b = output.index(0)
		output[b] = 1
	elif i == 'R':
		for j in range(9, -1, -1):
			if output[j] == 0:
				output[j] = 1
				break
	else:
		output[int(i)] = 0
print(*output, sep='')


x = int(input())
k = list(input())
p = ['0' for i in range(10)]
for i in range(x):
	if k[i] == 'R':
		for i in range(9, -1, -1):
			if p[i] == '0':
				p[i] = '1'
				break
	elif k[i] == 'L':
		for i in range(10):
			if p[i] == '0':
				p[i] = '1'
				break
	else:
		p[int(k[i])] = '0'
for i in p:
	print(i, end='')


n = int(input())
events = input()
ass = [0 for _ in range(10)]
for e in events:
	if e == 'L':
		for i in range(10):
			if ass[i] == 0:
				ass[i] = 1
				break
	elif e == 'R':
		for i in range(9, -1, -1):
			if ass[i] == 0:
				ass[i] = 1
				break
	else:
		ass[int(e)] = 0
print(''.join(map(str, ass)))


n = int(input())
string = input()
rooms_status = [0 for i in range(10)]
for char in string:
	if char == 'L':
		for i in range(10):
			if rooms_status[i] == 0:
				rooms_status[i] = 1
				break
	elif char == 'R':
		for i in range(9, -1, -1):
			if rooms_status[i] == 0:
				rooms_status[i] = 1
				break
	else:
		rooms_status[int(char)] = 0
for room_status in rooms_status:
	print(room_status, end='')
print()


a = int(input())
b = [char for char in input()]
c = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
r = 0
s = 0
while r < a:
	if b[r] == 'L':
		t = 0
		while t < 10:
			if c[t] != '1':
				c[t] = '1'
				break
			else:
				t = t + 1
	elif b[r] == 'R':
		t = 0
		while t < 10:
			if c[10 - t - 1] != '1':
				c[10 - t - 1] = '1'
				break
			else:
				t = t + 1
	else:
		c[int(b[r])] = '0'
	r = r + 1
print(''.join((char for char in c)))


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

def findLeft(list):
	index = 0
	for i in list:
		if i == 0:
			return index
		else:
			index += 1

def findRight(list):
	index = 9
	for i in list[::-1]:
		if i == 0:
			return index
		else:
			index -= 1
input()
for i in input():
	if i == 'L':
		x[findLeft(x)] = 1
	elif i == 'R':
		x[findRight(x)] = 1
	else:
		x[int(i)] = 0
for i in x:
	print(i, end='')


N = int(input())
s = list(input())
arr = '0' * 10
arr = list(map(int, arr))
for i in range(0, N):
	if s[i] == '0':
		arr[0] = 0
	if s[i] == '1':
		arr[1] = 0
	if s[i] == '2':
		arr[2] = 0
	if s[i] == '3':
		arr[3] = 0
	if s[i] == '4':
		arr[4] = 0
	if s[i] == '5':
		arr[5] = 0
	if s[i] == '6':
		arr[6] = 0
	if s[i] == '7':
		arr[7] = 0
	if s[i] == '8':
		arr[8] = 0
	if s[i] == '9':
		arr[9] = 0
	if s[i] == 'L':
		for j in range(0, 10):
			if arr[j] == 0:
				arr[j] = 1
				break
	if s[i] == 'R':
		for j in range(9, -1, -1):
			if arr[j] == 0:
				arr[j] = 1
				break
arr = map(str, arr)
print(''.join(arr))


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


n = int(input())
s = input()
rms = [0] * 10
a = ''
for i in s:
	if i == 'R':
		for y in range(9, -1, -1):
			if rms[y] == 0:
				rms[y] = 1
				break
	elif i == 'L':
		for z in range(10):
			if rms[z] == 0:
				rms[z] = 1
				break
	else:
		rms[int(i)] = 0
for p in rms:
	a += str(p)
print(a)


N = int(input())
events = list(input())
hotel = [False] * 10
for e in events:
	if e == 'L':
		for i in range(10):
			if not hotel[i]:
				break
		hotel[i] = True
	elif e == 'R':
		for i in range(9, -1, -1):
			if not hotel[i]:
				break
		hotel[i] = True
	else:
		hotel[int(e)] = False
print(''.join(map(lambda x: '1' if x else '0', hotel)))


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


n = int(input())
s = input()
l = [0] * 10
for i in s:
	if i == 'L':
		l[l.index(0)] = 1
	elif i == 'R':
		l[len(l) - 1 - l[::-1].index(0)] = 1
	else:
		l[int(i)] = 0
l1 = [str(i) for i in l]
print(''.join(l1))


def main():
	n = int(input())
	s = input()
	free = [0] * 10
	for c in s:
		if c == 'L':
			for i in range(10):
				if not free[i]:
					free[i] = 1
					break
		elif c == 'R':
			for i in reversed(range(10)):
				if not free[i]:
					free[i] = 1
					break
		else:
			free[int(c)] = 0
	print(''.join([str(i) for i in free]))
	return 0
main()


n = int(input())
s = str(input())
l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
	if s[i] == 'L':
		for k in range(10):
			if l[k] == 0:
				l[k] += 1
				break
	elif s[i] == 'R':
		for d in range(10):
			j = 10 - (1 + d)
			if l[j] == 0:
				l[j] += 1
				break
	else:
		l[int(s[i])] = 0
c1 = ''
for i in range(10):
	c1 += str(l[i])
print(c1)


n = int(input())
chronological_order = input()
assignment_status = []
for i in range(10):
	assignment_status.append(0)

def find_closest_empty_left():
	for i in range(10):
		if assignment_status[i] == 0:
			assignment_status[i] = 1
			break

def find_closest_empty_right():
	index = -1
	for i in range(10):
		if assignment_status[i] == 0:
			index = i
	assignment_status[index] = 1
for i in chronological_order:
	if i == 'L':
		find_closest_empty_left()
	elif i == 'R':
		find_closest_empty_right()
	else:
		assignment_status[int(i)] = 0
for i in assignment_status:
	print(i, end='')


N = int(input())
S = input()
A = [0 for k in range(10)]
for s in S:
	if s == 'L':
		for k in range(10):
			if A[k] == 0:
				A[k] = 1
				break
	elif s == 'R':
		for k in range(10):
			if A[-k - 1] == 0:
				A[-k - 1] = 1
				break
	else:
		t = int(s)
		A[t] = 0
ans = ''
for a in A:
	ans += str(a)
print(ans)


def hotel(n, s, x):
	for i in range(n):
		if s[i] == 'L':
			leftd(x)
		elif s[i] == 'R':
			rightd(x)
		else:
			q = s[i]
			q = int(q)
			x[q] = 0

def leftd(x):
	for j in range(10):
		if x[j] == 0:
			x[j] = 1
			break

def rightd(x):
	k = 9
	while k >= 0:
		if x[k] == 0:
			x[k] = 1
			break
		k = k - 1
n = input()
n = int(n)
s = input()
x = []
for i in range(10):
	x.append(0)
hotel(n, s, x)
for t in x:
	print(t, end='')


n = int(input())
l = list(input())
rooms = [0 for i in range(10)]
for i in l:
	if i == 'L':
		for j in range(10):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	else:
		rooms[int(i)] = 0
for i in range(10):
	print(rooms[i], end='')


n = int(input())
a = input()
b = [0 for i in range(10)]
tl = 0
tr = 9
for i in a:
	if i == 'L':
		b[tl] = 1
		for j in range(9, -1, -1):
			if b[j] == 0:
				tr = j
				break
		for j in range(0, 10, 1):
			if b[j] == 0:
				tl = j
				break
	elif i == 'R':
		b[tr] = 1
		for j in range(9, -1, -1):
			if b[j] == 0:
				tr = j
				break
		for j in range(0, 10, 1):
			if b[j] == 0:
				tl = j
				break
	else:
		b[int(i)] = 0
		for j in range(9, -1, -1):
			if b[j] == 0:
				tr = j
				break
		for j in range(0, 10, 1):
			if b[j] == 0:
				tl = j
				break
for i in b:
	print(i, end='')


class node:

	def __init__(self, data=None):
		self.data = data
		self.next = None
		self.last = None

class linked_list:

	def __init__(self):
		self.head = node()
		self.tail = node()
		self.head.next = self.tail
		self.tail.last = self.head

	def append(self, data=0):
		curr = self.head
		for i in range(10):
			new_node = node(0)
			new_node.last = curr
			new_node.next = curr.next
			curr.next = new_node
			self.tail.last = new_node
			curr = new_node

	def right(self, data=1):
		curr = self.tail.last
		while curr.data != 0:
			curr = curr.last
		curr.data = data

	def left(self, data=1):
		curr = self.head.next
		while curr.data != 0:
			curr = curr.next
		curr.data = data

	def len(self):
		curr = self.head
		total = 0
		while curr.next != None:
			curr = curr.next
			total += 1
		return total

	def display(self):
		elem = []
		curr = self.head
		while curr.next != None:
			curr = curr.next
			elem.append(curr.data)
		print(elem)

	def get(self, index):
		cur_idx = 0
		cur_node = self.head
		while True:
			cur_node = cur_node.next
			if cur_idx == index:
				return cur_node.data
			cur_idx += 1

	def erase(self, index):
		cur_idx = 0
		curr = self.head
		while curr.next != self.tail:
			curr = curr.next
			if cur_idx == index:
				curr.data = 0
				return
			cur_idx += 1

	def __getitem__(self, index):
		return self.get(index)
rooms = linked_list()
rooms.append()
n = int(input())
for i in input():
	if i == 'L':
		rooms.left()
	elif i == 'R':
		rooms.right()
	else:
		rooms.erase(int(i))
for i in range(10):
	print('{}'.format(rooms[i]), end='')


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


from sys import stdin, stdout
import math
N = int(input())
s = input()
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())
arr = ['0'] * 10
s = input()
for i in s:
	if i == 'L':
		for i in range(10):
			if arr[i] == '0':
				arr[i] = '1'
				break
	elif i == 'R':
		for i in range(9, -1, -1):
			if arr[i] == '0':
				arr[i] = '1'
				break
	else:
		arr[int(i)] = '0'
print(''.join(arr))


T = int(input())
a = input()
x = [0] * 10
ten = range(10)
for i in range(T):
	if a[i] == 'L':
		for j in ten:
			if x[j] == 0:
				x[j] = 1
				break
	elif a[i] == 'R':
		for j in reversed(ten):
			if x[j] == 0:
				x[j] = 1
				break
	else:
		x[int(a[i])] = 0
print(''.join((str(i) for i in x)))


rooms = ['0'] * 10
n = int(input())
S = input()
for s in S:
	if s == 'L':
		for l in range(10):
			if rooms[l] == '0':
				rooms[l] = '1'
				break
	elif s == 'R':
		for r in range(9, -1, -1):
			if rooms[r] == '0':
				rooms[r] = '1'
				break
	else:
		rooms[int(s)] = '0'
print(''.join(rooms))


n = int(input())
s = input()
ls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
left = 0
right = 9
for i in range(0, n):
	if s[i] == 'L':
		while ls[left] == 1:
			left += 1
		ls[left] = 1
		left = 0
	elif s[i] == 'R':
		while ls[right] == 1:
			right -= 1
		ls[right] = 1
		right = 9
	else:
		ls[int(s[i])] = 0
print(*ls, sep='')


n = int(input())
f = [0] * 10
for x in input():
	if 'L' == x:
		i = f.index(0)
		f[i] = 1
	elif 'R' == x:
		i = 9 - f[::-1].index(0)
		f[i] = 1
	else:
		i = int(x)
		f[i] = 0
print(''.join(map(str, f)))


n = int(input())
str = input()
str = [str[i:i + 1] for i in range(0, n, +1)]
room = []
init = 0
for i in range(0, 10, +1):
	room.append(init)
for i in str:
	if i == 'L':
		for place_l in range(0, 10, +1):
			if room[place_l] == 0:
				room[place_l] = 1
				break
	elif i == 'R':
		for place_r in range(9, -1, -1):
			if room[place_r] == 0:
				room[place_r] = 1
				break
	else:
		room[int(i)] = 0
for k in room:
	print(k, end='')


n = int(input())
a = [0] * 10
s = input()
for i in s:
	f = 0
	if i == 'L':
		for i in range(10):
			if a[i] == 0:
				a[i] = 1
				break
	elif i == 'R':
		for i in range(10):
			if a[10 - i - 1] == 0:
				a[10 - i - 1] = 1
				break
	else:
		x = int(i)
		a[x] = 0
print(''.join((str(e) for e in a)))


n = int(input())
s = input()
l = [0] * 10
for i in range(n):
	if s[i] == 'L':
		x = l.index(0)
		l[x] = 1
	elif s[i] == 'R':
		r = l.copy()
		r.reverse()
		x = r.index(0)
		l[10 - 1 - x] = 1
	else:
		x = int(s[i])
		l[x] = 0
for i in l:
	print(i, end='')


n = int(input())
entry = input()
rooms = [0] * 10
for letter in entry:
	if letter == 'L':
		for i in range(10):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	elif letter == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	else:
		rooms[int(letter)] = 0
print(*rooms, sep='')


n = int(input())
s = input()
p = '0000000000'
for i in s:
	if i == 'L':
		k = p.index('0')
		p = p[:k] + '1' + p[k + 1:]
	elif i == 'R':
		k = p.rindex('0')
		p = p[:k] + '1' + p[k + 1:]
	else:
		k = int(i)
		p = p[:k] + '0' + p[k + 1:]
print(p)


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


lens = int(input())
given = input()
rooms = [0] * 10
for i in given:
	if i == 'L':
		rooms[rooms.index(0)] = 1
	elif i == 'R':
		rooms[9 - rooms[::-1].index(0)] = 1
	else:
		rooms[int(i)] = 0
print(''.join(map(str, rooms)))


r0 = 0
r1 = 0
r2 = 0
r3 = 0
r4 = 0
r5 = 0
r6 = 0
r7 = 0
r8 = 0
r9 = 0
n = int(input())
s = input()
i = 0
while i < n:
	if s[i] == 'L':
		if r0 == 0:
			r0 = 1
			i += 1
			continue
		if r1 == 0:
			r1 = 1
			i += 1
			continue
		if r2 == 0:
			r2 = 1
			i += 1
			continue
		if r3 == 0:
			r3 = 1
			i += 1
			continue
		if r4 == 0:
			r4 = 1
			i += 1
			continue
		if r5 == 0:
			r5 = 1
			i += 1
			continue
		if r6 == 0:
			r6 = 1
			i += 1
			continue
		if r7 == 0:
			r7 = 1
			i += 1
			continue
		if r8 == 0:
			r8 = 1
			i += 1
			continue
		if r9 == 0:
			r9 = 1
			i += 1
			continue
	if s[i] == 'R':
		if r9 == 0:
			r9 = 1
			i += 1
			continue
		if r8 == 0:
			r8 = 1
			i += 1
			continue
		if r7 == 0:
			r7 = 1
			i += 1
			continue
		if r6 == 0:
			r6 = 1
			i += 1
			continue
		if r5 == 0:
			r5 = 1
			i += 1
			continue
		if r4 == 0:
			r4 = 1
			i += 1
			continue
		if r3 == 0:
			r3 = 1
			i += 1
			continue
		if r2 == 0:
			r2 = 1
			i += 1
			continue
		if r1 == 0:
			r1 = 1
			i += 1
			continue
		if r0 == 0:
			r0 = 1
			i += 1
			continue
	if s[i] == '0':
		r0 = 0
	if s[i] == '1':
		r1 = 0
	if s[i] == '2':
		r2 = 0
	if s[i] == '3':
		r3 = 0
	if s[i] == '4':
		r4 = 0
	if s[i] == '5':
		r5 = 0
	if s[i] == '6':
		r6 = 0
	if s[i] == '7':
		r7 = 0
	if s[i] == '8':
		r8 = 0
	if s[i] == '9':
		r9 = 0
	i += 1
if r0 == 1:
	print('1', end='')
else:
	print('0', end='')
if r1 == 1:
	print('1', end='')
else:
	print('0', end='')
if r2 == 1:
	print('1', end='')
else:
	print('0', end='')
if r3 == 1:
	print('1', end='')
else:
	print('0', end='')
if r4 == 1:
	print('1', end='')
else:
	print('0', end='')
if r5 == 1:
	print('1', end='')
else:
	print('0', end='')
if r6 == 1:
	print('1', end='')
else:
	print('0', end='')
if r7 == 1:
	print('1', end='')
else:
	print('0', end='')
if r8 == 1:
	print('1', end='')
else:
	print('0', end='')
if r9 == 1:
	print('1', end='')
else:
	print('0', end='')


n = int(input())
s = input()
temp = list('0000000000')

def setL(temp):
	for j in range(len(temp)):
		if temp[j] == '0':
			temp[j] = '1'
			break

def setR(temp):
	j = 9
	while j >= 0:
		if temp[j] == '0':
			temp[j] = '1'
			break
		j -= 1
for i in range(n):
	if s[i] == 'L':
		setL(temp)
	elif s[i] == 'R':
		setR(temp)
	else:
		temp[int(s[i])] = '0'
for i in range(len(temp)):
	print(temp[i], end='')


N = int(input())
string = input()
ans = [0] * 10
(j, k) = (0, 9)
for i in range(N):
	if string[i] == 'L':
		while ans[j] == 1:
			j += 1
		ans[j] = 1
	elif string[i] == 'R':
		while ans[k] == 1:
			k -= 1
		ans[k] = 1
	else:
		ans[int(string[i])] = 0
		j = min(j, int(string[i]))
		k = max(k, int(string[i]))
print(''.join(map(str, ans)))


n = int(input())
operationlist = input()
inputlist = []
for x in operationlist:
	inputlist.append(x)
outputlist = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for x in range(0, n):
	if inputlist[x] == 'L':
		for l in range(0, len(outputlist)):
			if outputlist[l] == 0:
				outputlist[l] = 1
				break
			else:
				continue
	elif inputlist[x] == 'R':
		for r in range(0, len(outputlist)):
			y = len(outputlist) - r - 1
			if outputlist[y] == 0:
				outputlist[y] = 1
				break
			else:
				continue
	else:
		outputlist[int(inputlist[x])] = 0
		continue
outputstr = ''
for x in outputlist:
	outputstr += str(x)
print(outputstr)


count_of_events = int(input())
events = input()
rooms = ['0' for _ in range(10)]
for event in events:
	if event == 'L':
		for i in range(10):
			if rooms[i] == '0':
				rooms[i] = '1'
				break
	elif event == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == '0':
				rooms[i] = '1'
				break
	elif event in [str(i) for i in range(10)]:
		rooms[int(event)] = '0'
print(''.join(rooms))


n = int(input())
a = input()
b = [0] * 10
x = 0
y = 9
for i in a:
	if i == 'L':
		if b[x] == 0:
			b[x] = 1
			x += 1
		else:
			while b[x] != 0 and x < n:
				x += 1
			b[x] = 1
			x += 1
	elif i == 'R':
		if b[y] == 0:
			b[y] = 1
			y -= 1
		else:
			while b[y] != 0 and y > -1:
				y -= 1
			b[y] = 1
			y -= 1
	else:
		b[int(i)] = 0
		if int(i) < x:
			x = int(i)
		elif int(i) > y:
			y = int(i)
b = ''.join(list(map(str, b)))
print(b)


import sys
import os
import math
import copy
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations, accumulate

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def watch(x):
	return print(x)

def common(l1, l2):
	return set(l1).intersection(l2)

def Most_frequent(list):
	return max(set(list), key=list.count)

def solution():
	tc = Int()
	a = Lstr()
	ans = ['0'] * 10
	cl = 0
	cr = 9
	for i in range(tc):
		if a[i] == 'L':
			for j in range(10):
				if ans[j] == '0':
					ans[j] = '1'
					break
		elif a[i] == 'R':
			for j in range(9, -1, -1):
				if ans[j] == '0':
					ans[j] = '1'
					break
		else:
			ans[int(a[i])] = '0'
	print(''.join(ans))
solution()


R = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
n = int(input())
E = input()
for i in range(n):
	if E[i] == 'L':
		R[R.index(0)] = 1
	elif E[i] == 'R':
		R[max((i for (i, x) in enumerate(R) if x == 0))] = 1
	else:
		R[int(E[i])] = 0
print(*R, sep='')


input()
a = ['0'] * 10
for i in input():
	if i == 'L':
		a[a.index('0')] = '1'
	elif i == 'R':
		a[-1 - a[::-1].index('0')] = '1'
	else:
		a[int(i)] = '0'
print(''.join(a))


n = int(input())
ss = input()
inl = 0
inr = 9
a = [0] * 10
for i in range(n):
	if ss[i] == 'L':
		if a[inl] == 1:
			while a[inl] == 1:
				inl += 1
		a[inl] += 1
		inl += 1
	elif ss[i] == 'R':
		if a[inr] == 1:
			while a[inr] == 1:
				inr -= 1
		a[inr] += 1
		inr -= 1
	else:
		s = int(ss[i])
		a[s] = 0
		if s < inl:
			inl = s
		elif s > inr:
			inr = s
		else:
			continue
for i in a:
	print(i, end='')


n = int(input())
s = input()
arr = [0] * 10
(l, r) = (0, 9)
for i in s:
	if i == 'L':
		j = 0
		while arr[j]:
			j += 1
		arr[j] = 1
	elif i == 'R':
		j = 9
		while arr[j]:
			j -= 1
		arr[j] = 1
	else:
		arr[int(i)] = 0
print(*arr, sep='')


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

def findl():
	for i in range(10):
		if ans[i] == '0':
			return i
	return -1

def findr():
	for i in range(9, -1, -1):
		if ans[i] == '0':
			return i
	return -1
for i in range(n):
	if s[i] == 'L':
		ans[findl()] = '1'
	elif s[i] == 'R':
		ans[findr()] = '1'
	else:
		ans[int(s[i])] = '0'
print(*ans, sep='')


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)))


import math
from decimal import Decimal
import heapq

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)
n = int(input())
s = input()
a = [0] * 10
lstl = 0
lstr = n - 1
for i in s:
	if i == 'L':
		for i in range(10):
			if a[i] == 0:
				a[i] = 1
				break
	elif i == 'R':
		for i in range(10 - 1, -1, -1):
			if a[i] == 0:
				a[i] = 1
				break
	else:
		a[int(i)] = 0
for i in a:
	print(i, end='')


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


import sys
input = sys.stdin.readline
n = int(input())
s = input()
room = [0 for i in range(10)]
for i in range(n):
	temp = s[i]
	if temp == 'L':
		for i in range(10):
			if room[i] == 0:
				room[i] = 1
				break
	elif temp == 'R':
		for i in range(9, -1, -1):
			if room[i] == 0:
				room[i] = 1
				break
	else:
		temp = int(temp)
		room[temp] = 0
room = [str(i) for i in room]
print(''.join(room))


a = int(input())
t = input()
z = '0000000000'
for i in range(a):
	if t[i].isdigit():
		z = z[:int(t[i])] + '0' + z[int(t[i]) + 1:]
	if t[i] == 'L':
		for b in range(10):
			if z[b] == '0':
				z = z[:b] + '1' + z[b + 1:]
				break
	if t[i] == 'R':
		for b in range(9, -1, -1):
			if z[b] == '0':
				z = z[:b] + '1' + z[b + 1:]
				break
print(z)


def hotel_room(n, data):
	rooms = [0 for x in range(10)]
	for x in data:
		if x.isdigit():
			rooms[int(x)] = 0
			continue
		elif x == 'L':
			pos = rooms.index(0)
			rooms[pos] = 1
		elif x == 'R':
			for x in range(9, -1, -1):
				if not rooms[x]:
					pos = x
					break
			rooms[pos] = 1
	return rooms
n = int(input().strip())
data = input().strip()
ret = hotel_room(n, data)
print(''.join(map(str, ret)))


n = int(input())
m = input()
a = ['0'] * 10
for i in range(n):
	if m[i] == 'L':
		a[a.index('0')] = '1'
	elif m[i] == 'R':
		a[9 - a[::-1].index('0')] = '1'
	else:
		a[int(m[i])] = '0'
print(''.join(a))


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


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


c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
act = ''
n = int(input())
act = input()
act = list(act)
for i in range(n):
	if act[i] == 'R':
		for x in range(9, -1, -1):
			if c[x] == 0:
				c[x] = 1
				break
	elif act[i] == 'L':
		for x in range(10):
			if c[x] == 0:
				c[x] = 1
				break
	else:
		c[int(act[i])] = 0
rez = ''
for i in c:
	rez = rez + str(i)
print(rez)


n = int(input())
s = input()
p = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
	if s[i] == 'L':
		for j in range(len(p)):
			if p[j] != 1:
				p[j] = 1
				break
	elif s[i] == 'R':
		d = len(p) - 1
		while d >= 0:
			if p[d] != 1:
				p[d] = 1
				break
			d = d - 1
	else:
		p[int(s[i])] = 0
k = ''
for a in p:
	k = k + str(a)
print(k)


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())
string = input()
memory = [0] * 10
a = memory.index(0)
for i in string:
	if i == 'L':
		a = memory.index(0)
		memory[a] = 1
	elif i == 'R':
		memory.reverse()
		a = memory.index(0)
		memory[a] = 1
		memory.reverse()
	else:
		memory[int(i)] = 0
for i in memory:
	print(i, end='')


n = int(input())
l = input()
a = [0] * 10
j = 9
i = 0
for k in range(n):
	if l[k] == 'R':
		while a[j] == 1 and j >= 0:
			j = j - 1
		a[j] = 1
		j = 9
	elif l[k] == 'L':
		while a[i] == 1 and i <= 9:
			i = i + 1
		a[i] = 1
		i = 0
	elif l[k] >= '0' and l[k] <= '9':
		ni = int(l[k])
		a[ni] = 0
for p in range(10):
	print(a[p], end='')


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


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	ans = [0] * 10
	l = S()
	for x in l:
		if x == 'L':
			for i in range(10):
				if ans[i] == 0:
					ans[i] = 1
					break
		elif x == 'R':
			for i in range(10)[::-1]:
				if ans[i] == 0:
					ans[i] = 1
					break
		else:
			x = int(x)
			ans[x] = 0
	return ''.join((str(x) for x in ans))
print(main())


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


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
DIRECTIONS = [[0, 1], [0, -1], [1, 0], [1, -1]]
NEIGHBOURS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i != 0 or j != 0]
OrdUnicode_a = ord('a')
OrdUnicode_A = ord('A')
CAPS_ALPHABETS = {chr(i + OrdUnicode_A): i for i in range(26)}
SMOL_ALPHABETS = {chr(i + OrdUnicode_a): i for i in range(26)}
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0) + 1
INFINITY = float('inf')
rooms = ['0'] * 10
N = int(input())
S = input()
for i in S:
	if i == 'L':
		for i in range(10):
			if rooms[i] == '0':
				rooms[i] = '1'
				break
	elif i == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == '0':
				rooms[i] = '1'
				break
	else:
		rooms[int(i)] = '0'
print(''.join(rooms))


n = int(input())
mem = input()
room = [0 for i in range(10)]
for c in mem:
	if c == 'L':
		for (i, r) in enumerate(room):
			if r == 0:
				room[i] = 1
				break
	elif c == 'R':
		for (i, r) in enumerate(room[::-1]):
			if r == 0:
				room[10 - i - 1] = 1
				break
	else:
		room[int(c)] = 0
print(''.join((str(i) for i in room)))


n = int(input())
s = input()
l = [0] * 10
for i in s:
	try:
		k = int(i)
		l[k] = 0
	except ValueError:
		if i == 'L':
			l[l.index(0)] = 1
		else:
			l.reverse()
			l[l.index(0)] = 1
			l.reverse()
for i in l:
	print(i, end='')


import sys
import re

def has_numbers(string):
	return bool(re.search('\\d', string))

def parse_by_map(only_strings=False):
	lines = []
	for line in sys.stdin:
		if not has_numbers(line) or only_strings:
			lines.append(map(str, line.strip().split(' ')))
		else:
			lines.append(map(int, line.strip().split(' ')))
	return lines

def map_collection_to_list_collection(map_collection):
	list_collection = []
	for collection in map_collection:
		list_collection.append(list(collection))
	return list_collection

def assign_client(list1):
	for (idx, status) in enumerate(list1):
		if status == 0:
			list1[idx] = 1
			break
	return list1
input_map = parse_by_map(only_strings=True)
input_list = map_collection_to_list_collection(input_map)
rooms_status = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
sequence = input_list[1][0]
for move in sequence:
	if move == 'L':
		rooms_status = assign_client(rooms_status)
	elif move == 'R':
		rooms_status.reverse()
		rooms_status = assign_client(rooms_status)
		rooms_status.reverse()
	else:
		rooms_status[int(move)] = 0
for i in rooms_status:
	print(i, end='')


n = int(input())
s = list(input())
rooms = []
for _ in range(10):
	rooms.append(0)
for x in s:
	if x == 'L':
		for i in range(10):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	elif x == 'R':
		i = 9
		while i >= 0:
			if rooms[i] == 0:
				rooms[i] = 1
				break
			i -= 1
	else:
		rooms[int(x)] = 0
print(''.join((str(a) for a in rooms)))


(n, s) = (int(input()), input())
a = [0] * 10
j = 0
for i in s:
	if i == 'L':
		j = 0
		while j < 10:
			if a[j] == 0:
				a[j] = 1
				break
			j += 1
	elif i == 'R':
		j = 9
		while j >= 0:
			if a[j] == 0:
				a[j] = 1
				break
			j -= 1
	else:
		a[int(i)] = 0
print(*a, sep='')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = ii()
	s = si()
	l = [0] * 10
	for i in range(n):
		if s[i] == 'L':
			for i in range(n):
				if l[i] == 0:
					l[i] = 1
					break
		elif s[i] == 'R':
			for i in range(9, -1, -1):
				if l[i] == 0:
					l[i] = 1
					break
		else:
			l[int(s[i])] = 0
	for i in range(10):
		print(l[i], end='')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
events = input()
lst = [0] * 10
for i in range(len(events)):
	if events[i] == 'L':
		a = 0
		true = True
		while true:
			if lst[a] == 0:
				lst[a] = 1
				true = False
			else:
				a += 1
	elif events[i] == 'R':
		a = -1
		true = True
		while true:
			if lst[a] == 0:
				lst[a] = 1
				true = False
			else:
				a -= 1
	else:
		c = int(events[i])
		lst[c] = 0
for i in lst:
	print(i, end='')


T = int(input())
r = [0] * 10
q = input()
for x in range(T):
	if q[x] == 'L':
		for i in range(10):
			if r[i] == 0:
				r[i] = 1
				break
	elif q[x] == 'R':
		for i in range(1, 11):
			if r[-i] == 0:
				r[-i] = 1
				break
	else:
		t = int(q[x])
		r[t] = 0
print(*r, sep='')


r = [0] * 10
n = int(input())
el = input()
for e in el:
	if e == 'L':
		r[r.index(0)] = 1
	elif e == 'R':
		r[9 - r[::-1].index(0)] = 1
	else:
		r[int(e)] = 0
print(*r, sep='')


m = int(input())
s = input()
l = 10 * [0]
for i in s:
	if i == 'L':
		l[l.index(0)] = 1
	elif i == 'R':
		l.reverse()
		l[l.index(0)] = 1
		l.reverse()
	else:
		l[int(i)] = 0
l = [str(i) for i in l]
l = ''.join(l)
print(l)


n = int(input())
st = input()
rooms = ['0' for i in range(10)]
nextleft = 0
nextright = 9
for ch in st:
	if ch == 'L':
		rooms[nextleft] = '1'
		if nextleft == nextright:
			nextright = -1
			nextleft = 10
		else:
			while rooms[nextleft] == '1':
				nextleft += 1
	elif ch == 'R':
		rooms[nextright] = '1'
		if nextleft == nextright:
			nextright = -1
			nextleft = 10
		else:
			while rooms[nextright] == '1':
				nextright -= 1
	else:
		rooms[int(ch)] = '0'
		if int(ch) < nextleft:
			nextleft = int(ch)
		if int(ch) > nextright:
			nextright = int(ch)
answer = ''
for ch in rooms:
	answer += ch
print(answer)


n = int(input())
events = list(input())
output = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
io = 0
for i in events:
	io = 0
	ior = 9
	if i == 'L':
		while output[io] == '1':
			io += 1
		output[io] = '1'
	elif i == 'R':
		while output[ior] == '1':
			ior -= 1
		output[ior] = '1'
	else:
		output[int(i)] = '0'
string = ''
for i in output:
	string += str(i)
print(string)


n = int(input())
seq = input()
ls = [False] * 10
for x in seq:
	if x == 'L':
		for i in range(10):
			if not ls[i]:
				ls[i] = True
				break
	elif x == 'R':
		for i in range(9, -1, -1):
			if not ls[i]:
				ls[i] = True
				break
	else:
		ls[int(x)] = False
print(''.join(map(lambda x: '1' if x else '0', ls)))


events = int(input())
str = input()
arr = [0] * 10
for i in str:
	if i == 'L':
		for j in range(0, 10):
			if arr[j] == 0:
				arr[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if arr[j] == 0:
				arr[j] = 1
				break
	else:
		arr[int(i)] = 0
for i in arr:
	print(i, end='')


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


a = int(input())
b = input()
rooms = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in b:
	if i == 'L':
		for l in range(10):
			if not rooms[l]:
				rooms[l] = 1
				break
	elif i == 'R':
		for l in range(10):
			if not rooms[9 - l]:
				rooms[9 - l] = 1
				break
	else:
		rooms[int(i)] = 0
for i in rooms:
	print(i, end='')


basura = input()
size = input()

def findLeftmost(l):
	for i in range(len(l)):
		if l[i] is 0:
			return i

def findRightmost(l):
	for i in range(len(l) - 1, -1, -1):
		if l[i] is 0:
			return i
l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in size:
	if i is 'L':
		l[findLeftmost(l)] = 1
	elif i is 'R':
		l[findRightmost(l)] = 1
	else:
		l[int(i)] = 0
string = ''
for i in l:
	string += str(i)
print(string)


mylist = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

def left_insert(hotel):
	for idx in range(10):
		if hotel[idx] == 0:
			hotel[idx] = 1
			break

def right_insert(hotel):
	for idx in range(10):
		if hotel[-(idx + 1)] == 0:
			hotel[-(idx + 1)] = 1
			break

def leave(hotel, index):
	hotel[index] = 0
events = int(input())
assign = input()
for i in range(events):
	if assign[i] == 'L':
		left_insert(mylist)
	elif assign[i] == 'R':
		right_insert(mylist)
	else:
		int_assign = int(assign[i])
		leave(mylist, int_assign)
for i in mylist:
	print(i, end='')


r = [0] * 10
input()
for c in input():
	try:
		r[int(c)] = 0
	except:
		f = c > 'L'
		g = 1 - 2 * f
		r[-f + g * r[::g].index(0)] = 1
print(*r, sep='')


n = int(input())
l = input()
l = list(l)
li = [0 for i in range(0, 10)]
for i in range(0, n):
	if l[i] == 'L':
		j = 0
		while j < 10:
			if li[j] == 0:
				li[j] = 1
				break
			else:
				j += 1
	elif l[i] == 'R':
		h = 9
		while h >= 0:
			if li[h] == 0:
				li[h] = 1
				break
			else:
				h -= 1
	else:
		li[int(l[i])] = 0
print(''.join((str(i) for i in li)))


N = int(input())
rooms = [False for i in range(10)]
L = 0
R = 9
for e in input():
	if e == 'L':
		for i in range(10):
			if rooms[i] == False:
				break
		rooms[i] = True
	elif e == 'R':
		for i in reversed(range(10)):
			if rooms[i] == False:
				break
		rooms[i] = True
	else:
		rooms[int(e)] = False
print(''.join(('01'[o] for o in rooms)))


n = int(input())
a = '0000000000'
line = input()
for i in range(len(line)):
	if 'L' in line[i]:
		pos = a.find('0')
		a = a[0:pos] + '1' + a[pos + 1:]
	elif 'R' in line[i]:
		pos = a.rfind('0')
		a = a[:pos] + '1' + a[pos + 1:]
	else:
		pos = int(line[i])
		a = a[0:pos] + '0' + a[pos + 1:]
print(a)


n = int(input())
h = [0] * 10
a = input()
(l, r) = (0, 9)
for i in range(n):
	if a[i] == 'L':
		while h[l] != 0:
			l += 1
		h[l] = 1
		l += 1
	elif a[i] == 'R':
		while h[r] != 0:
			r -= 1
		h[r] = 1
		r -= 1
	else:
		x = int(a[i])
		h[x] = 0
		if l > x:
			l = x
		if r < x:
			r = x
print(*h, sep='')


n = int(input())
log = input()
left = 0
right = 9
hotel = [0] * 10
for l in log:
	if l == 'L':
		for i in range(10):
			if hotel[i] == 0:
				left = i
				break
		hotel[left] = 1
	elif l == 'R':
		for i in range(9, -1, -1):
			if hotel[i] == 0:
				right = i
				break
		hotel[right] = 1
	else:
		pos = int(l)
		hotel[pos] = 0
print(''.join(map(str, hotel)))


k = int(input())
list1 = input()
list2 = [0] * 10
for i in list1:
	if i == 'L':
		list2[list2.index(0)] = 1
	elif i == 'R':
		list2[len(list2) - 1 - list2[::-1].index(0)] = 1
	else:
		list2[int(i)] = 0
print(''.join((str(i) for i in list2)))


camere = [0] * 10
n = int(input())
k = input()
for x in k:
	if x == 'L':
		for j in range(len(camere)):
			if camere[j] == 0:
				camere[j] = 1
				break
	elif x == 'R':
		for j in range(len(camere) - 1, -1, -1):
			if camere[j] == 0:
				camere[j] = 1
				break
	else:
		x = int(x)
		camere[x] = 0
print(''.join(map(str, camere)))


l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
n = int(input())
x = list(input())
leave = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
for i in range(n):
	if x[i] == 'L':
		for j in range(len(l)):
			if l[j] == 0:
				l[j] = 1
				break
	elif x[i] == 'R':
		for j in range(len(l)):
			if l[len(l) - 1 - j] == 0:
				l[len(l) - 1 - j] = 1
				break
	elif x[i] in leave:
		l[int(x[i])] = 0
for i in l:
	print(i, end='')


from sys import stdin
from collections import deque
r = stdin.readline

def solve(events):
	(ans, lo, hi, ldq, rdq) = ([False for _ in range(10)], 0, 9, deque(), deque())
	for event in events:
		if event == 'L':
			for i in range(10):
				if ans[i] == 0:
					ans[i] = not ans[i]
					break
		elif event == 'R':
			for i in range(9, -1, -1):
				if ans[i] == 0:
					ans[i] = not ans[i]
					break
		else:
			x = event
			ans[int(x)] = False
			ldq.append(int(x)) if int(x) <= 4 else rdq.append(int(x))
	ans_str = ''
	for i in range(10):
		if ans[i]:
			ans_str += '1'
		else:
			ans_str += '0'
	return ans_str

def main():
	n = int(r())
	events = r().strip()
	print(solve(events))
main()


def get_play_of_actions(actions):
	rooms_states = [False] * 10
	for action in actions:
		if action == 'L':
			index = 0
			while rooms_states[index]:
				index += 1
			rooms_states[index] = True
		elif action == 'R':
			index = 9
			while rooms_states[index]:
				index -= 1
			rooms_states[index] = True
		else:
			index = int(action)
			rooms_states[index] = False
	return ''.join(['1' if state else '0' for state in rooms_states])

def solve():
	input()
	actions = input()
	print(get_play_of_actions(actions))
solve()


def fill_hotel_num(hotel, rng):
	for x in rng:
		if hotel[x] == '0':
			hotel[x] = '1'
			return

def op(hotel, symbol):
	if symbol.isdigit():
		hotel[int(symbol)] = '0'
	elif symbol == 'R':
		fill_hotel_num(hotel, range(9, -1, -1))
	else:
		fill_hotel_num(hotel, range(10))
	return hotel
str_len = int(input())
ops = input()
hotel = ['0' for x in range(10)]
for x in range(str_len):
	hotel = op(hotel, ops[x])
print(''.join(hotel))


n = int(input())
memory = list(input())
rooms = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for event in memory:
	if event == 'L':
		for x in range(10):
			if rooms[x] == 0:
				rooms[x] = 1
				break
	elif event == 'R':
		for x in reversed(range(10)):
			if rooms[x] == 0:
				rooms[x] = 1
				break
	else:
		x = int(event)
		rooms[x] = 0
for room in rooms:
	print(room, end='', flush=True)


n = int(input())
lst = list(input())
room_state = ['0' for i in range(10)]
for i in range(n):
	if lst[i] == 'L':
		index = room_state.index('0')
		room_state[index] = '1'
	elif lst[i] == 'R':
		index = room_state[::-1].index('0')
		room_state[9 - index] = '1'
	else:
		room_state[int(lst[i])] = '0'
result = ''.join(room_state)
print(result)


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


n = int(input())
r = input()
out = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
	for j in range(10):
		if r[i] == 'L' and out[j] == 0:
			out[j] = 1
			break
		elif r[i] == 'R' and out[9 - j] == 0:
			out[9 - j] = 1
			break
	else:
		out[int(r[i])] = 0
for k in out:
	print(k, end='')


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


a = int(input())
b = str(input())
c = [0] * 10
for k in b:
	if k == 'L':
		c[c.index(0)] = 1
	elif k == 'R':
		c.reverse()
		c[c.index(0)] = 1
		c.reverse()
	else:
		c[int(k)] = 0
s = ''
for k in c:
	s += str(k)
print(s)


from collections import deque
n = int(input())
inp = input()
arr = ['0' for i in range(10)]
for i in inp:
	if i == 'L':
		j = 0
		while arr[j] != '0':
			j += 1
		arr[j] = '1'
	elif i == 'R':
		j = 9
		while arr[j] != '0':
			j -= 1
		arr[j] = '1'
	else:
		arr[int(i)] = '0'
print(''.join(arr))


n = int(input())
s = input()
a = ['0'] * 10
t = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in s:
	if i == 'L':
		a[t[0]] = '1'
		del t[0]
	elif i == 'R':
		a[t[-1]] = '1'
		del t[-1]
	else:
		a[int(i)] = '0'
		t.append(int(i))
		t.sort()
m = ''
for i in a:
	m += i
print(m)


from sys import stdin
from sys import setrecursionlimit as SRL
SRL(10 ** 7)
rd = stdin.readline
rrd = lambda : map(int, rd().strip().split())
n = int(input())
sta = [0] * 10
s = str(rd().strip())
for i in s:
	if i == 'R':
		for j in range(9, -1, -1):
			if sta[j] == 0:
				sta[j] = 1
				break
	elif i == 'L':
		for j in range(10):
			if sta[j] == 0:
				sta[j] = 1
				break
	else:
		sta[int(i)] = 0
ans = ''
for i in sta:
	ans += str(i)
print(ans)


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


hotel = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
n = int(input())
eventos = input()
indice = 0
derecha = 9
for i in eventos:
	if i == 'L':
		while hotel[indice] != '0':
			indice += 1
		hotel[indice] = '1'
		indice = 0
	elif i == 'R':
		while hotel[derecha] != '0':
			derecha -= 1
		hotel[derecha] = '1'
		derecha = 9
	else:
		cuarto = int(i)
		hotel[cuarto] = '0'
for i in hotel:
	print(i, end='')


n = int(input())
x = input()
l = 0
r = len(x) - 1
sol = [0] * 10
for item in x:
	if item == 'L':
		for j in range(10):
			if sol[j] == 0:
				sol[j] = 1
				break
	elif item == 'R':
		for j in range(10):
			if sol[10 - j - 1] == 0:
				sol[10 - j - 1] = 1
				break
	else:
		vac = int(item)
		sol[vac] = 0
for i in sol:
	print(i, end='')


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


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


n = int(input())
input_str = input()
arr = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
for i in input_str:
	if i == 'L':
		for j in range(len(arr)):
			if arr[j] == '0':
				arr[j] = '1'
				break
	elif i == 'R':
		for j in range(len(arr)):
			if arr[9 - j] == '0':
				arr[9 - j] = '1'
				break
	else:
		arr[int(i)] = '0'
print(''.join(arr))


def main():
	n = int(input())
	s = input()
	h = [False for i in range(11)]
	for i in range(n):
		if s[i] == 'L':
			for i in range(10):
				if h[i] == False:
					h[i] = True
					break
		elif s[i] == 'R':
			for i in range(9, -1, -1):
				if h[i] == False:
					h[i] = True
					break
		else:
			h[ord(s[i]) - ord('0')] = False
	ans = ''
	for i in range(10):
		if h[i] == True:
			ans += '1'
		else:
			ans += '0'
	print(ans)
main()


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())
l = [0] * 10
s = input()
for i in s:
	if i == 'L':
		l[l.index(0)] = 1
	elif i == 'R':
		l[9 - l[::-1].index(0)] = 1
	else:
		l[int(i)] = 0
for i in l:
	print(i, end='')


n = int(input())
s = list(input())
a = 10 * [0]
opened = []
for j in range(0, 10):
	opened.append(j)
for i in range(n):
	if s[i] == 'L':
		a[min(opened)] = 1
		del opened[opened.index(min(opened))]
	elif s[i] == 'R':
		a[max(opened)] = 1
		del opened[opened.index(max(opened))]
	else:
		a[int(s[i])] = 0
		opened.append(int(s[i]))
print(*a, sep='')


import sys
rooms = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
numEvents = int(sys.stdin.readline())
events = sys.stdin.readline()
events.rstrip()

def fill_left():
	for (num, room) in enumerate(rooms):
		if room == 0:
			rooms[num] = 1
			return

def fill_right():
	for (num, room) in reversed(list(enumerate(rooms))):
		if room == 0:
			rooms[num] = 1
			return

def leave(room):
	rooms[room] = 0
for i in range(numEvents):
	if events[i] == 'L':
		fill_left()
	elif events[i] == 'R':
		fill_right()
	else:
		leave(int(events[i]))
print(''.join(map(str, rooms)))


import math
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)


n = int(input())
memory = list(input())
rooms = [0] * 10
left = 0
right = 9
for i in range(n):
	if memory[i] == 'L':
		flag = 0
		for i in range(5):
			if rooms[i] == 0:
				rooms[i] = 1
				flag = 1
				break
		if flag != 1:
			i = 5
			while i <= 9:
				if rooms[i] == 0:
					rooms[i] = 1
					break
				i += 1
	elif memory[i] == 'R':
		flag = 0
		i = 9
		while i >= 5:
			if rooms[i] == 0:
				rooms[i] = 1
				flag = 1
				break
			i -= 1
		if flag != 1:
			i = 4
			while i >= 0:
				if rooms[i] == 0:
					rooms[i] = 1
					break
				i -= 1
	else:
		x = int(memory[i])
		rooms[x] = 0
for i in range(10):
	print(rooms[i], end='')


n = int(input())
cust = input()
rooms = [0] * 10
for i in cust:
	if i == 'L':
		rooms[rooms.index(0)] = 1
	elif i == 'R':
		rooms[9 - rooms[::-1].index(0)] = 1
	else:
		rooms[int(i)] = 0
print(*rooms, sep='')


n = int(input())
s = input()
ans = ['0'] * 10
for ch in s:
	if ch == 'L':
		i = 0
		while i < 10 and ans[i] == '1':
			i += 1
		ans[i] = '1'
	elif ch == 'R':
		i = 9
		while i >= 0 and ans[i] == '1':
			i -= 1
		ans[i] = '1'
	else:
		ans[int(ch)] = '0'
res = ''
for ch in ans:
	res += ch
print(res)


from array import *
from string import *
n = int(input())
st = input()
arr = array('i', [0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
for i in range(len(st)):
	if st[i] == 'L':
		for i in range(len(arr)):
			if arr[i] == 0:
				arr[i] = 1
				break
	elif st[i] == 'R':
		for i in range(len(arr) - 1, -1, -1):
			if arr[i] == 0:
				arr[i] = 1
				break
	else:
		arr[int(st[i])] = 0
for i in arr:
	print(i, end='')


n = int(input())
s = input()
l = []
l[:10] = [0] * 10
for i in s:
	if i == 'L':
		j = 0
		while l[j] != 0:
			j += 1
		l[j] = 1
	elif i == 'R':
		j = 9
		while l[j] != 0:
			j -= 1
		l[j] = 1
	else:
		l[int(i)] = 0
ans = ''.join([str(i) for i in l])
print(ans)


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


import re
from collections import deque
from functools import reduce
from heapq import *
from itertools import permutations
from math import pi
from operator import itemgetter
from operator import mul
from operator import xor
from os import linesep

def fmatr(matrix, lnsep: str=linesep, fieldsep: str=' ') -> str:
	return lnsep.join(map(lambda row: fieldsep.join(map(str, row)), matrix))

def fbool(boolval: int) -> str:
	return ['No', 'Yes'][boolval]

def solve() -> None:
	n = int(input())
	s = input()
	ans = [0] * 10
	for c in s:
		if c == 'L':
			for i in range(10):
				if ans[i] == 1:
					continue
				ans[i] = 1
				break
			continue
		elif c == 'R':
			for i in range(10):
				if ans[-1 - i] == 1:
					continue
				ans[-1 - i] = 1
				break
			continue
		leave = ord(c) - ord('0')
		ans[leave] = 0
	ans = list(map(str, ans))
	print(fmatr([ans], '', ''))
solve()


for _ in range(1):
	n = int(input())
	l = 0
	r = 9
	room = [0] * 10
	s = str(input())
	for i in s:
		if i == 'L':
			room[room.index(0)] = 1
		elif i == 'R':
			room[-(room[::-1].index(0) + 1)] = 1
		else:
			k = int(i)
			room[k] = 0
	print(*room, sep='')


from queue import PriorityQueue
n = int(input())
s = input()
a = [0 for _ in range(10)]
l = 0
r = 9
for c in s:
	if c == 'L':
		while a[l] == 1:
			l += 1
		a[l] = 1
	elif c == 'R':
		while a[r] == 1:
			r -= 1
		a[r] = 1
	else:
		v = int(c)
		a[v] = 0
		if v < l:
			l = v
		elif v > r:
			r = v
print(''.join(map(str, a)))


room = [0] * 10
c = int(input())
for ch in input():
	if ch == 'L':
		room[room.index(0)] = 1
	elif ch == 'R':
		room[9 - room[::-1].index(0)] = 1
	else:
		room[int(ch)] = 0
print(*room, sep='')


n = int(input())
s = input()
d = dict()
for i in range(10):
	d[i] = 0
left = 0
right = 9
for i in s:
	if i == 'L':
		for j in range(10):
			if d[j] == 0:
				left = j
				break
		d[left] = 1
	elif i == 'R':
		for j in range(9, -1, -1):
			if d[j] == 0:
				right = j
				break
		d[right] = 1
	else:
		d[int(i)] = 0
ans = ''
for i in range(10):
	ans += str(d[i])
print(ans)


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


n = int(input())
s = input()
y = []
for i in s:
	y.append(i)
arr = [0] * 10
for i in y:
	if i == 'L':
		j = 0
		while j < 10:
			if arr[j] == 0:
				arr[j] = 1
				break
			j += 1
	elif i == 'R':
		j = 9
		while j >= 0:
			if arr[j] == 0:
				arr[j] = 1
				break
			j -= 1
	else:
		arr[int(i)] = 0
for _ in arr:
	print(_, end='')


len_inp = int(input())
inp = input()
occupied_arr = ['0'] * 10
for hist in inp:
	if hist == 'L':
		left_temp = 0
		while left_temp < 10 and occupied_arr[left_temp] == '1':
			left_temp += 1
		occupied_arr[left_temp] = '1'
	elif hist == 'R':
		right_temp = 9
		while right_temp > -1 and occupied_arr[right_temp] == '1':
			right_temp -= 1
		occupied_arr[right_temp] = '1'
	else:
		occupied_arr[int(hist)] = '0'
print(''.join(occupied_arr))


n = int(input())
a = input()
b = [0] * 10
l = 0
r = 9
c = 11
for i in range(n):
	if a[i] == 'L':
		b[b.index(0)] = 1
	elif a[i] == 'R':
		b[9 - b[::-1].index(0)] = 1
	else:
		b[int(a[i])] = 0
for i in range(10):
	print(b[i], end='')


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


input()
(s, r, l) = (input(), ['0'] * 10, ['0'] * 10)
for i in s:
	if i == 'L':
		k = l.index('0')
		l[k] = '1'
		r[9 - k] = '1'
	elif i == 'R':
		k = r.index('0')
		r[k] = '1'
		l[9 - k] = '1'
	else:
		l[int(i)] = '0'
		r[9 - int(i)] = '0'
print(''.join(l))


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def eld(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()

def fac(n):
	ans = 1
	for i in range(1, n + 1):
		ans *= i
		ans %= MOD
	return ans
n = int(input())
s = input()
x = [0] * 10
l = 0
r = 9
for i in range(n):
	if s[i] == 'L':
		while l < 10 and x[l] == 1:
			l += 1
		x[l] = 1
		l += 1
	elif s[i] == 'R':
		while r >= 0 and x[r] == 1:
			r -= 1
		x[r] = 1
		r -= 1
	else:
		t = int(s[i])
		x[t] = 0
		if t < l:
			l = t
		if t > r:
			r = t
print(''.join(map(str, x)))


def rooms(l, c):
	if c == 'L':
		l[l.index(0)] = 1
	elif c == 'R':
		l[9 - l[::-1].index(0)] = 1
	else:
		l[int(c)] = 0
n = int(input())
l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in list(input()):
	rooms(l, i)
print(''.join(str(l).split(', '))[1:-1])


e = int(input())
events = list(input())
rooms = [False for _ in range(10)]
for cmd in events:
	if cmd == 'L':
		i = 0
		while rooms[i]:
			i += 1
		rooms[i] = True
	elif cmd == 'R':
		i = 9
		while rooms[i]:
			i -= 1
		rooms[i] = True
	else:
		rooms[int(cmd)] = False
for i in rooms:
	if i:
		print(1, end='')
	else:
		print(0, end='')


from __future__ import division, print_function
from collections import *
from math import *
from itertools import *
from time import time
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	n = int(input())
	s = input()
	ar = [0] * 10
	for i in range(n):
		if s[i] == 'L':
			check = ar.index(0)
			ar[check] = 1
		elif s[i] == 'R':
			dummy = ''.join(map(str, ar))
			check = dummy.rfind('0')
			ar[check] = 1
		else:
			ar[int(s[i])] = 0
	print(''.join(map(str, ar)))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
s = input()
room = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
for i in s:
	if i == 'L':
		for j in range(10):
			if room[j] == '0':
				room[j] = '1'
				break
	elif i == 'R':
		for k in range(10):
			revRoom = room[::-1]
			if revRoom[k] == '0':
				revRoom[k] = '1'
				room = revRoom[::-1]
				break
	else:
		room[int(i)] = '0'
print(''.join(room))


import math
n = int(input())
s = input()
s = list(s)
l = [0] * 10
for i in range(n):
	if s[i] == 'L':
		for j in range(10):
			if l[j] == 0:
				l[j] = 1
				break
	elif s[i] == 'R':
		for k in range(9, -1, -1):
			if l[k] == 0:
				l[k] = 1
				break
	else:
		l[int(s[i])] = 0
for m in l:
	print(m, end='')


n = int(input())
s = ['0'] * 10
l = input()
for i in range(n):
	if l[i] == 'L':
		s[s.index('0')] = '1'
	elif l[i] == 'R':
		c = s[::-1]
		s[9 - c.index('0')] = '1'
	else:
		s[int(l[i])] = '0'
print(''.join(s))


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


t = int(input())
n = input()
result = [0] * 10
for char in n:
	if char == 'L':
		for i in range(10):
			if result[i] == 0:
				result[i] = 1
				break
	if char == 'R':
		for i in range(9, -1, -1):
			if result[i] == 0:
				result[i] = 1
				break
	if char != 'L' and char != 'R':
		result[int(char)] = 0
for ele in result:
	print(ele, end='')


n = int(input())
b = '0' * 10
a = str(input())
for i in range(len(a)):
	if a[i] == 'L':
		for j in range(10):
			if b[j] == '0':
				b = b[0:j] + '1' + b[j + 1:]
				break
	elif a[i] == 'R':
		for j in range(9, -1, -1):
			if b[j] == '0':
				b = b[0:j] + '1' + b[j + 1:]
				break
	else:
		c = int(a[i])
		b = b[0:c] + '0' + b[c + 1:]
print(b)


num = int(input())
string = input()
rooms = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(len(string)):
	if string[i] == 'L':
		for s in range(len(rooms)):
			if rooms[s] == 0:
				rooms[s] = 1
				break
	elif string[i] == 'R':
		for s in range(len(rooms) - 1, -1, -1):
			if rooms[s] == 0:
				rooms[s] = 1
				break
	else:
		rooms[int(string[i])] = 0
print(*rooms, sep='')


n = int(input())
s = input()
h = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
for x in s:
	if x == 'L':
		i = 0
		while True:
			if h[i] == '0':
				h[i] = '1'
				break
			i += 1
	if x == 'R':
		i = 9
		while True:
			if h[i] == '0':
				h[i] = '1'
				break
			i -= 1
	if x != 'L' and x != 'R':
		h[int(x)] = '0'
print(''.join(h))


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


n = int(input())
s = input()
arr = [0 for i in range(10)]

def L():
	for i in range(10):
		if arr[i] == 0:
			arr[i] = 1
			break

def R():
	for i in range(9, -1, -1):
		if arr[i] == 0:
			arr[i] = 1
			break

def printR():
	for i in range(10):
		print(arr[i], end='')
for i in range(n):
	if s[i] == 'L':
		L()
		continue
	if s[i] == 'R':
		R()
		continue
	else:
		temp = ord(s[i]) - 48
		arr[temp] = 0
printR()


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


n = int(input())
s = input()
l = [0] * 10
for i in s:
	if i == 'L':
		pos = 0
		while l[pos] != 0:
			pos += 1
		l[pos] = 1
	elif i == 'R':
		pos = -1
		while l[pos] != 0:
			pos -= 1
		l[pos] = 1
	else:
		l[int(i)] = 0
for i in l:
	print(i, end='')
print()


totalEvents = int(input())
mainList = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
mainStr = input()
for a in mainStr:
	if a == 'L':
		for b in range(10):
			if mainList[b] == 0:
				mainList[b] = 1
				break
			else:
				continue
	elif a == 'R':
		for b in range(9, -1, -1):
			if mainList[b] == 0:
				mainList[b] = 1
				break
			else:
				continue
	else:
		mainList[int(a)] = 0
for a in mainList:
	print(a, end='')


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


n = int(input())
s = input()
t = '0000000000'
for i in range(n):
	if '0' <= s[i] <= '9':
		t = t[0:int(s[i])] + '0' + t[int(s[i]) + 1:]
	if s[i] == 'L':
		for j in range(10):
			if t[j] == '0':
				t = t[0:j] + '1' + t[j + 1:]
				break
	if s[i] == 'R':
		for j in range(10):
			if t[9 - j] == '0':
				t = t[0:9 - j] + '1' + t[9 - j + 1:]
				break
print(t)


n = int(input())
s = input()
arr = [0 for i in range(10)]
for j in range(len(s)):
	if s[j] == 'L':
		for i in range(10):
			if arr[i] == 0:
				arr[i] = 1
				break
	elif s[j] == 'R':
		for i in range(9, -1, -1):
			if arr[i] == 0:
				arr[i] = 1
				break
	else:
		arr[int(s[j])] = 0
res = ''
for i in range(10):
	res += str(arr[i])
print(res)


s = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
lens = input()
str = input()
for i in range(int(lens)):
	if str[i] == 'L':
		for _ in range(len(s)):
			if s[_] == '0':
				s[_] = '1'
				break
	elif str[i] == 'R':
		for _ in range(len(s) - 1, -1, -1):
			if s[_] == '0':
				s[_] = '1'
				break
	else:
		s[int(str[i])] = '0'
ans = ''.join(s)
print(ans)


def assignment_status(n, input_str):
	l = [0] * 10
	for i in range(n):
		if input_str[i] == 'L':
			for j in range(n):
				if l[j] == 0:
					l[j] += 1
					break
		elif input_str[i] == 'R':
			for j in range(1, n + 1):
				if l[-j] == 0:
					l[-j] += 1
					break
		else:
			l[int(input_str[i])] = 0
	return l
n = int(input())
l = input()
print(''.join((str(i) for i in assignment_status(n, l))))


n = int(input())
out = [0] * 10
x = input()
for t in range(n):
	if x[t] == 'L':
		for i in range(10):
			if not out[i]:
				out[i] = 1
				break
	elif x[t] == 'R':
		for i in range(9, -1, -1):
			if not out[i]:
				out[i] = 1
				break
	else:
		out[ord(x[t]) - ord('0')] = 0
for i in range(10):
	print(out[i], end='')


n = int(input())
S = input()
arr = [0] * 10
left = 0
right = 9
for ch in S:
	if ch == 'L':
		for i in range(10):
			if arr[i] == 0:
				arr[i] = 1
				break
		continue
	if ch == 'R':
		for i in range(9, -1, -1):
			if arr[i] == 0:
				arr[i] = 1
				break
		continue
	arr[int(ch)] = 0
res = ''
for x in arr:
	res += str(x)
print(res)


def main():
	free = {i for i in range(10)}
	q = int(input())
	queries = input()
	for query in queries:
		if query == 'L':
			free -= {min(free)}
		elif query == 'R':
			free -= {max(free)}
		else:
			free.add(int(query))
	for i in range(10):
		if i in free:
			print('0', end='')
		else:
			print('1', end='')
main()


n = int(input())
s = input()
b = '0000000000'
for i in range(n):
	if s[i] == 'L':
		b = b[:b.find('0')] + '1' + b[b.find('0') + 1:]
	elif s[i] == 'R':
		b = b[::-1]
		b = b[:b.find('0')] + '1' + b[b.find('0') + 1:]
		b = b[::-1]
	else:
		b = b[:int(s[i])] + '0' + b[int(s[i]) + 1:]
print(b)


n = int(input())
s = input()
a = []
for i in range(10):
	a.append(0)
for i in s:
	if i == 'L':
		b = a.index(0)
		a[b] += 1
	elif i == 'R':
		b = a[::-1].index(0)
		a[len(a) - 1 - b] += 1
	else:
		a[int(i)] = 0
c = ''
for i in a:
	c += str(i)
print(c, end='')


l = [0] * 10
input()
for s in input():
	if s == 'L':
		i = 0
		while l[i]:
			i += 1
		l[i] = 1
	elif s == 'R':
		i = 9
		while l[i]:
			i -= 1
		l[i] = 1
	else:
		l[int(s)] = 0
print(*l, sep='')


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
q = [0] * 10
l = z()
for i in l:
	if i == 'L':
		q[q.index(0)] = 1
	elif i == 'R':
		t = q[::-1].index(0)
		q[9 - t] = 1
	else:
		q[int(i)] = 0
print(''.join((str(i) for i in q)))


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


n = int(input())
a = [0 for i in range(10)]
s = input()
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:
		x = int(i)
		a[x] = 0
ans = ''
for i in a:
	ans += str(i)
print(ans)


n = int(input())
ans = [0] * 10
a = list(input())
lastl = 0
lastr = 9
for i in range(0, len(a)):
	lastl = 0
	lastr = 9
	if a[i] == 'L':
		while ans[lastl] == 1:
			lastl += 1
		ans[lastl] = 1
	elif a[i] == 'R':
		while ans[lastr] == 1:
			lastr -= 1
		ans[lastr] = 1
	elif int(int(a[i])) <= 4:
		ans[int(a[i])] = 0
	elif int(a[i]) >= 5:
		ans[int(a[i])] = 0
for i in range(0, 10):
	print(ans[i], end='')


l = ['0'] * 10
sl = int(input())
s = input()
for e in s:
	if e == 'L':
		l[l.index('0')] = '1'
	elif e == 'R':
		l[9 - l[::-1].index('0')] = '1'
	else:
		l[int(e)] = '0'
print(''.join(l))


(_, s, ns) = (input(), input(), [0 for _ in range(10)])
for c in s:
	if c == 'L':
		ns[ns.index(0)] = 1
	elif c == 'R':
		ns[9 - ns[::-1].index(0)] = 1
	else:
		ns[int(c)] = 0
print(''.join(map(str, ns)))


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

def fill_left():
	left_pointer = 0
	while left_pointer < n:
		if rooms[left_pointer] == '0':
			rooms[left_pointer] = '1'
			break
		left_pointer += 1

def fill_right():
	right_pointer = 9
	while right_pointer > -1:
		if rooms[right_pointer] == '0':
			rooms[right_pointer] = '1'
			break
		right_pointer -= 1
for i in input():
	if i == 'L':
		fill_left()
	elif i == 'R':
		fill_right()
	else:
		rooms[int(i)] = '0'
print(''.join(rooms))


n = int(input())
ev = input()
arr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for elem in ev:
	if elem == 'L':
		arr[arr.index(0)] = 1
	elif elem == 'R':
		for (i, e) in reversed(list(enumerate(arr))):
			if arr[i] == 0:
				arr[i] = 1
				break
	elif 0 <= int(elem) <= 9:
		arr[int(elem)] = 0
print(''.join(map(str, arr)))


import sys
in_file = sys.stdin
n = int(in_file.readline().strip())
A = in_file.readline().strip()
status = ['0' for i in range(10)]
for a in A:
	if a == 'L':
		i = 0
		while i < 9 and status[i] == '1':
			i += 1
		status[i] = '1'
	elif a == 'R':
		i = 9
		while i > 0 and status[i] == '1':
			i -= 1
		status[i] = '1'
	else:
		i = int(a)
		status[i] = '0'
sys.stdout.write(''.join(status))
sys.stdout.flush()


def add_l(a):
	i = 0
	while a[i] == 1:
		i += 1
	a[i] = 1

def add_r(a):
	i = 9
	while a[i] == 1:
		i -= 1
	a[i] = 1

def main():
	n = int(input())
	string = input()
	rooms = list()
	for i in range(10):
		rooms.append(0)
	for move in string:
		if move == 'L':
			add_l(rooms)
		elif move == 'R':
			add_r(rooms)
		else:
			rooms[int(move)] = 0
	print(''.join(map(str, rooms)))
main()


x = input()
string = input()
res = []
for item in range(0, 10):
	res.append(0)
f_ptr = 0
e_ptr = 9
for s in string:
	if s == 'L':
		for i in range(0, 10):
			if res[i] == 0:
				res[i] = 1
				break
	elif s == 'R':
		for i in range(9, -1, -1):
			if res[i] == 0:
				res[i] = 1
				break
	else:
		res[int(s)] = 0
for item in res:
	print(item, end='')


n = int(input())
S = input()
Empty = list(range(10))
Rooms = [0] * 10
for s in S:
	if s == 'L':
		r = Empty.pop(0)
		Rooms[r] = 1
	elif s == 'R':
		r = Empty.pop()
		Rooms[r] = 1
	else:
		t = int(s)
		Rooms[t] = 0
		Empty.append(t)
		Empty.sort()
print(''.join(map(str, Rooms)))


n = int(input())
s = input()
l = [0] * 10
z = 9
k = 0
i = 0
while i < len(s):
	if s[i] == 'L' and l[k] == 0:
		l[k] = 1
		k += 1
		i += 1
	elif s[i] == 'R' and l[z] == 0:
		l[z] = 1
		z -= 1
		i += 1
	elif s[i] in '0123456789':
		x = s[i]
		l[int(x)] = 0
		for j in l:
			if j == 0:
				k = j
				break
		j = 9
		while j >= 0:
			if l[j] == 0:
				z = j
				break
			j -= 1
		i += 1
	else:
		if s[i] == 'L' and l[k] == 1:
			k += 1
		if s[i] == 'R' and l[z] == 1:
			z -= 1
print(''.join(map(str, l)))


operations = int(input())
string = input()

def allot_left(room):
	i = 0
	while room[i] != '0':
		i += 1
	room[i] = '1'

def allot_right(room):
	i = -1
	while room[i] != '0':
		i -= 1
	room[i] = '1'
room = ['0' for i in range(0, 10)]
for i in string:
	if i == 'L':
		allot_left(room)
	elif i == 'R':
		allot_right(room)
	elif i.isnumeric():
		room[int(i)] = '0'
print(''.join(map(str, room)))


n = int(input())
str1 = input()
rooms = [0] * 10
for i in str1:
	if i == 'L':
		for i in range(10):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	elif i == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	else:
		index = int(i)
		rooms[index] = 0
str2 = ''
for i in rooms:
	str2 += str(i)
print(str2)


n = int(input())
z = list((0 for x in range(10)))
s = input()[:n]
for x in s:
	if x == 'L':
		for y in z:
			if y == 0:
				z[z.index(y)] = 1
				break
	elif x == 'R':
		for y in range(len(z) - 1, -1, -1):
			if z[y] == 0:
				z[y] = 1
				break
	else:
		z[int(x)] = 0
print(''.join(map(str, z)))


from collections import defaultdict as DD
from bisect import bisect_left as BL
from bisect import bisect_right as BR
from itertools import combinations as IC
from itertools import permutations as IP
from random import randint as RI
import sys
MOD = pow(10, 9) + 7

def IN(f=0):
	if f == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
n = IN(1)
s = input()
h = [0 for i in range(10)]
for i in range(n):
	if s[i] == 'L':
		for j in range(10):
			if h[j] == 0:
				h[j] = 1
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if h[j] == 0:
				h[j] = 1
				break
	else:
		j = int(s[i])
		h[j] = 0
h = [str(i) for i in h]
print(''.join(h))


def solve(events):
	rooms = [0] * 10
	for event in events:
		if event == 'L':
			for i in range(10):
				if rooms[i] == 0:
					rooms[i] = 1
					break
		elif event == 'R':
			for i in range(10):
				if rooms[9 - i] == 0:
					rooms[9 - i] = 1
					break
		else:
			rooms[int(event)] = 0
	return ''.join(list(map(str, rooms)))
n = int(input())
events = input()
print(solve(events))


n = int(input())
memo = input()
dicta = dict()
for i in range(10):
	dicta[i] = 0
for j in range(n):
	if memo[j] == 'L':
		for k in range(10):
			if dicta[k] == 0:
				dicta[k] += 1
				break
			else:
				continue
	elif memo[j] == 'R':
		for f in range(10)[::-1]:
			if dicta[f] == 0:
				dicta[f] += 1
				break
			else:
				continue
	elif dicta[int(memo[j])] == 0:
		continue
	else:
		dicta[int(memo[j])] -= 1
for value in dicta.values():
	print(value, end='')


def hotel(customer_status):
	initial_rooms = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
	for i in customer_status:
		(j, k) = (0, 9)
		if i == 'L':
			while initial_rooms[j] == '1':
				j += 1
			initial_rooms[j] = '1'
		elif i == 'R':
			while initial_rooms[k] == '1':
				k -= 1
			initial_rooms[k] = '1'
		else:
			initial_rooms[int(i)] = '0'
	print(''.join(initial_rooms))
t = int(input())
customer_status = list(input())
hotel(customer_status)


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


n1 = int(input())
n = [int(0) for i in range(10)]
st = input()
for i in range(len(st)):
	if st[i] == 'L':
		for j in range(len(n)):
			if n[j] is 0:
				n[j] = 1
				break
	elif st[i] is 'R':
		for j in reversed(range(len(n))):
			if n[j] is 0:
				n[j] = 1
				break
	elif int(st[i]) >= 0 or int(st[i]) < 10:
		n[int(st[i])] = 0
for i in range(len(n)):
	print(n[i], end='')


n = int(input())
s = input()
temp1 = temp2 = -1
arr = [0] * 10
for i in s:
	if i == 'L':
		j = 0
		while j < 10:
			if arr[j] == 0:
				arr[j] = 1
				break
			j += 1
	elif i == 'R':
		j = 9
		while j >= 0:
			if arr[j] == 0:
				arr[j] = 1
				break
			j -= 1
	else:
		temp = int(i)
		arr[temp] = 0
for i in arr:
	print(i, end='')


N = int(input())
Room = ['0' for _ in range(10)]
L = list(input())
for i in L:
	if ord(i) <= 65:
		Room[int(i)] = '0'
	elif i == 'L':
		for idx in range(len(Room)):
			if Room[idx] == '0':
				Room[idx] = '1'
				break
	else:
		for idx in range(len(Room) - 1, -1, -1):
			if Room[idx] == '0':
				Room[idx] = '1'
				break
print(''.join(Room))


n = int(input())
a = input()
b = ['0'] * 10
for i in a:
	if i == 'L':
		j = 0
		while 1:
			if b[j] == '0':
				break
			else:
				j += 1
		b[j] = '1'
	elif i == 'R':
		j = 0
		while 1:
			if b[9 - j] == '0':
				break
			else:
				j += 1
		b[9 - j] = '1'
	else:
		b[int(i)] = '0'
print(''.join(b))


n = int(input())
string = input()
l = [0] * 10
left = 0
right = 9
ls = -1
for i in string:
	if i == 'L':
		for j in range(10):
			if l[j] == 0:
				l[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if l[j] == 0:
				l[j] = 1
				break
	elif i == '0' or i == '1' or i == '2' or (i == '3') or (i == '4') or (i == '5') or (i == '6') or (i == '7') or (i == '8') or (i == '9'):
		ls = int(i)
		l[ls] = 0
for i in l:
	print(i, end='')


n = int(input())
a = list(input())
l = [0] * 10
for x in range(n):
	if a[x] == 'L':
		for i in range(10):
			if l[i] == 0:
				l[i] = 1
				break
	elif a[x] == 'R':
		for i in range(1, 11):
			if l[-i] == 0:
				l[-i] = 1
				break
	else:
		l[int(a[x])] = 0
for x in l:
	print(x, end='')


n = int(input())
str1 = input()
out = [0] * 10
for i in range(n):
	if str1[i] == 'L':
		for j in range(len(out)):
			if out[j] == 0:
				out[j] = 1
				break
	elif str1[i] == 'R':
		for j in reversed(range(len(out))):
			if out[j] == 0:
				out[j] = 1
				break
	else:
		out[int(str1[i])] = 0
for i in range(10):
	print(out[i], end='')


import heapq

def solve():
	n = int(input())
	rooms = [0] * 10
	assignments = input()
	for a in assignments:
		if a == 'L':
			for i in range(10):
				if rooms[i] == 0:
					rooms[i] = 1
					break
		elif a == 'R':
			for i in reversed(range(10)):
				if rooms[i] == 0:
					rooms[i] = 1
					break
		else:
			rooms[int(a)] = 0
	print(''.join(map(str, rooms)))

def main():
	solve()
main()


Hotels = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
input()
X = input()
for i in X:
	if i == 'L':
		index = 0
		while index < 10:
			if Hotels[index] == 0:
				Hotels[index] = 1
				break
			index += 1
	elif i == 'R':
		index = 9
		while index >= 0:
			if Hotels[index] == 0:
				Hotels[index] = 1
				break
			index -= 1
	else:
		Hotels[int(i)] = 0
print(*Hotels, sep='')


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


n = int(input())
room = [0 for x in range(10)]
s = [x for x in input()]
for l in s:
	if l == 'L':
		room[room.index(0)] = 1
	elif l == 'R':
		room[9 - room[::-1].index(0)] = 1
	else:
		room[int(l)] = 0
k = ''
for x in room:
	k = k + str(x)
print(k)


def find(a, d):
	if d == 'L':
		for i in range(0, 10):
			if a[i] == 0:
				return i
	else:
		i = 9
		while i >= 0:
			if a[i] == 0:
				return i
			i = i - 1
n = int(input())
s = input()
a = [0] * 10
for i in range(0, n):
	if s[i] == 'L':
		a[find(a, 'L')] = 1
	elif s[i] == 'R':
		a[find(a, 'R')] = 1
	elif s[i] >= '0' and s[i] <= '9':
		x = int(s[i])
		a[x] = 0
for i in a:
	print(i, end='')


n = int(input())
instructions = input()
rooms = '0000000000'
for i in instructions:
	if i == 'L':
		rooms = rooms.replace('0', '1', 1)
	elif i == 'R':
		rooms = rooms[::-1].replace('0', '1', 1)[::-1]
	else:
		room = list(rooms)
		room[int(i)] = '0'
		rooms = ''.join(room)
print(rooms)


n = int(input())
arr = input()
rooms = ['0'] * 10
for i in arr:
	if i == 'L':
		for x in range(len(rooms)):
			if rooms[x] == '0':
				rooms[x] = '1'
				break
	elif i == 'R':
		for x in range(len(rooms) - 1, -1, -1):
			if rooms[x] == '0':
				rooms[x] = '1'
				break
	else:
		rooms[int(i)] = '0'
s = ''.join(rooms)
print(s)


x = int(input())
s = str(input())
l = [0 for x in range(10)]
for t in s[0:x]:
	if t == 'L':
		for (ii, y) in enumerate(l):
			if y == 0:
				l[int(ii)] = 1
				break
	if t == 'R':
		for (i, y) in enumerate(l[::-1]):
			if y == 0:
				l[-int(i + 1)] = 1
				break
	if t in [str(x) for x in range(10)]:
		l[int(t)] = 0
st = ''
for u in l:
	st += str(u)
print(st)


def auxiliary(my_list, event_amount, event_string):
	i = 0
	while i < 10:
		my_list.append(0)
		i = i + 1
	for event in event_string:
		if event == 'L':
			empty_room_index = my_list.index(0, 0, event_amount)
			my_list[empty_room_index] = 1
		elif event == 'R':
			empty_room_index = find_index(my_list)
			my_list[empty_room_index] = 1
		else:
			event_converted_to_number = int(event)
			my_list[event_converted_to_number] = 0
	for entry in my_list:
		print(entry, end='')

def find_index(my_list):
	i = len(my_list) - 1
	while my_list[i] != 0:
		i -= 1
	return i

def main():
	event_amount = int(input())
	event_string = input()
	my_list = []
	auxiliary(my_list, event_amount, event_string)
main()


def left():
	for i in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9):
		if rooms[i] == 0:
			rooms[i] += 1
			break

def right():
	for i in (9, 8, 7, 6, 5, 4, 3, 2, 1, 0):
		if rooms[i] == 0:
			rooms[i] += 1
			break

def deleteRoom(no):
	for i in range(len(rooms)):
		if i == no:
			rooms[i] -= 1
n = int(input())
string = input()
rooms = [0] * 10
for s in string:
	if s == 'L':
		left()
	elif s == 'R':
		right()
	elif int(s) in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9):
		deleteRoom(int(s))
print(''.join(map(str, rooms)))


n = int(input())
st = input()
lt = [0] * 10
for x in st:
	if x == 'L':
		for i in range(10):
			if lt[i] == 0:
				lt[i] = 1
				break
	elif x == 'R':
		for j in range(9, -1, -1):
			if lt[j] == 0:
				lt[j] = 1
				break
	else:
		lt[int(x)] = 0
print(*lt, sep='')


n = int(input())
seq = input()
res = [0 for j in range(10)]
l = 0
r = 9
for i in range(n):
	step = seq[i]
	if step.isdigit():
		res[int(step)] = 0
		l = 0
		r = 9
	elif step == 'L':
		while 1 > 0:
			if res[l] == 1:
				l += 1
			else:
				res[l] = 1
				break
	else:
		while 1 > 0:
			if res[r] == 1:
				r -= 1
			else:
				res[r] = 1
				break
print(''.join((str(elem) for elem in res)))


import math as ma
from sys import exit

def li():
	return list(map(int, input().split()))

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

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mm = 1000000007
yp = 0

def solve():
	t = 1
	for tt in range(t):
		n = nu()
		s = input()
		a = [0] * 10
		for i in range(n):
			if s[i] == 'L':
				for j in range(10):
					if a[j] == 0:
						a[j] = 1
						break
				continue
			if s[i] == 'R':
				for j in range(9, -1, -1):
					if a[j] == 0:
						a[j] = 1
						break
				continue
			a[int(s[i])] = 0
		print(*a, sep='')
solve()


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


def solve(test):
	ans = list('0000000000')
	n = int(input())
	s = input()
	for c in s:
		ind = -1
		if c == 'L':
			for i in range(10):
				if ans[i] == '0':
					ind = i
					break
		elif c == 'R':
			for i in range(9, -1, -1):
				if ans[i] == '0':
					ind = i
					break
		else:
			ind = int(c)
		ans[ind] = chr(ord('0') + 1 - int(ans[ind]))
	print(''.join(ans))
t = 1
for _ in range(t):
	solve(_ + 1)


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


def solution():
	from sys import stdout, stdin
	(_input, _print) = (stdin.readline, stdout.write)
	(_int, _range, _min, _max) = (int, range, min, max)
	n = int(input())
	s = input()
	arr = [0] * 10
	for i in s:
		if i == 'L':
			for index in range(10):
				if arr[index] == 0:
					arr[index] = 1
					break
		elif i == 'R':
			for index in range(9, -1, -1):
				if arr[index] == 0:
					arr[index] = 1
					break
		else:
			arr[int(i)] = 0
	print(''.join([str(i) for i in arr]))
solution()


n = int(input())
ls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
s = input()
for ch in s:
	if ch == 'L':
		for i in range(len(ls)):
			if ls[i] == 0:
				ls[i] = 1
				break
	elif ch == 'R':
		i = 9
		while i > -1:
			if ls[i] == 0:
				ls[i] = 1
				break
			i -= 1
	else:
		ls[int(ch)] = 0
ans = ''
for i in ls:
	ans += str(i)
print(ans)


testcase = int(input())
LR = []
for i in range(10):
	LR.insert(i, 0)
str = input().upper()
for i in range(testcase):
	if str[i] == 'L':
		for j in range(0, 10):
			if LR[j] == 0:
				LR[j] = 1
				break
	elif str[i] == 'R':
		for k in range(9, -1, -1):
			if LR[k] == 0:
				LR[k] = 1
				break
	elif 0 <= int(str[i]) <= 9:
		LR[int(str[i])] = 0
for i in LR:
	print(i, end='')


def input(f):
	(n,) = map(int, f.readline().split())
	s = f.readline()
	return (n, s)

def solve(n, s):
	rooms = [0 for _ in range(10)]
	for i in range(n):
		if s[i] == 'L':
			for j in range(10):
				if rooms[j] == 0:
					rooms[j] = 1
					break
		elif s[i] == 'R':
			for j in range(10):
				if rooms[9 - j] == 0:
					rooms[9 - j] = 1
					break
		else:
			rooms[int(s[i])] = 0
	return ''.join(map(str, rooms))
import sys
print(solve(*input(sys.stdin)))


def find_empty_room(side):
	if side == 'L':
		i = 0
		while room_assignment[i] != 0:
			i += 1
		room_assignment[i] = 1
	else:
		i = len(room_assignment) - 1
		while room_assignment[i] != 0:
			i -= 1
		room_assignment[i] = 1
	return

def free_the_room(index):
	room_assignment[index] = 0
	return
content = [input() for i in range(2)]
for i in range(0, len(content)):
	content[i] = content[i].replace('\n', '')
room_assignment = [0 for x in range(10)]
for i in range(int(content[0])):
	if content[1][i] == 'L' or content[1][i] == 'R':
		find_empty_room(content[1][i])
	else:
		free_the_room(int(content[1][i]))
print(*room_assignment, sep='')


numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
n = int(input())
d = [0] * 10
s = input()
for i in range(len(s)):
	if s[i] == 'L':
		d[d.index(0)] = 1
	elif s[i] == 'R':
		d = d[::-1]
		d[d.index(0)] = 1
		d = d[::-1]
	else:
		d[int(s[i])] = 0
for i in d:
	print(i, end='')


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


TestCases = int(input())
Customers = input()
sz = len(Customers)
Rooms = [0] * 10
for i in range(sz):
	if Customers[i] == 'L':
		for j in range(10):
			if Rooms[j] == 0:
				Rooms[j] = 1
				break
	elif Customers[i] == 'R':
		for j in range(10 - 1, -1, -1):
			if Rooms[j] == 0:
				Rooms[j] = 1
				break
	else:
		Rooms[int(Customers[i])] = 0
print(*Rooms, sep='')


n = int(input())
Rooms = ['0' for i in range(10)]
allot = input()
left = 0
right = 9
for char in allot:
	if char == 'L':
		for i in range(0, 10):
			if Rooms[i] == '0':
				Rooms[i] = '1'
				break
	elif char == 'R':
		for i in range(9, -1, -1):
			if Rooms[i] == '0':
				Rooms[i] = '1'
				break
	else:
		Rooms[int(char)] = '0'
print(''.join(Rooms))


import sys
from collections import defaultdict
input = sys.stdin.readline

def main():
	n = int(input().strip())
	s = input().strip()
	rooms = [0] * 10
	for c in s:
		if c in ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'):
			rooms[int(c)] = 0
		elif c == 'L':
			pos = 0
			while rooms[pos] != 0:
				pos += 1
			rooms[pos] = 1
		else:
			pos = 9
			while rooms[pos] != 0:
				pos -= 1
			rooms[pos] = 1
	print(''.join(map(str, rooms)))
main()


a = int(input())
b = input()
l = []
r = []
x = [x for x in range(10)]
for i in range(len(b)):
	if b[i] == 'L':
		l.append(x[0])
		x.pop(x.index(x[0]))
	elif b[i] == 'R':
		r.append(x[len(x) - 1])
		x.pop(x.index(x[len(x) - 1]))
	elif b[i] == '1' or b[i] == '2' or b[i] == '3' or (b[i] == '4') or (b[i] == '5') or (b[i] == '6') or (b[i] == '7') or (b[i] == '8') or (b[i] == '9') or (b[i] == '0'):
		if int(b[i]) in l:
			x.append(int(b[i]))
			x.sort()
			l.pop(l.index(int(b[i])))
		else:
			x.append(int(b[i]))
			x.sort()
			r.pop(r.index(int(b[i])))
g = [1 for i in range(10)]
for i in x:
	g[i] = 0
print(''.join(map(str, g)))


n = int(input())
w = input()
w = list(w)
L = 0
R = 0
m = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']

def con(x):
	r = ''.join(map(str, x))
	return r

def l(m):
	c = 0
	while int(m[c]) > 0:
		c = c + 1
	return c

def p(m):
	c = 9
	while int(m[c]) > 0:
		c = c - 1
	return c

def s(x):
	if x == 'L':
		del m[l(m)]
		m.insert(0, '1')
	elif x == 'R':
		del m[p(m)]
		m.insert(9, '1')
	else:
		x = int(x)
		del m[x]
		m.insert(x, '0')
	return m
for i in w:
	m = s(i)
print(con(m))


p = [0] * 10
n = int(input())
a = input()
for i in range(n):
	if a[i] == 'L':
		x = p.index(0)
		p[x] = 1
	elif a[i] == 'R':
		x = 9 - p[::-1].index(0)
		p[x] = 1
	else:
		p[int(a[i])] = 0
print(*p, sep='')


r = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
n = int(input())
s = input()
for i in range(n):
	if s[i] == 'L':
		r[r.index('0')] = '1'
	elif s[i] == 'R':
		r = r[::-1]
		r[r.index('0')] = '1'
		r = r[::-1]
	else:
		r[int(s[i])] = '0'
print(''.join(r))


def answer():
	n = int(input())
	s = list(input())
	i = 0
	h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
	while i < len(s):
		if s[i] == 'L':
			j = 0
			while j < len(h):
				if h[j] == 1:
					pass
				else:
					h[j] = 1
					break
				j += 1
		elif s[i] == 'R':
			j = len(h) - 1
			while j >= 0:
				if h[j] == 1:
					pass
				else:
					h[j] = 1
					break
				j -= 1
		else:
			z = int(s[i])
			h[z] = 0
		i += 1
	ans = ''
	for x in h:
		ans += str(x)
	return ans
print(answer())


_ = input()
rooms = [0 for i in range(10)]
for i in input():
	if i == 'L':
		for room in range(10):
			if rooms[room] == 0:
				rooms[room] = 1
				break
	elif i == 'R':
		for room in range(9, -1, -1):
			if rooms[room] == 0:
				rooms[room] = 1
				break
	else:
		rooms[int(i)] = 0
for i in rooms:
	print(i, end='')


n = int(input())
p = ['0'] * 10
t = list(input())
for j in range(len(t)):
	if 48 <= ord(t[j]) <= 57:
		p[int(t[j])] = '0'
	elif t[j] == 'L':
		for k in range(len(t)):
			if p[k] == '0':
				p[k] = '1'
				break
	elif t[j] == 'R':
		for n in range(1, len(t) + 1):
			if p[-n] == '0':
				p[-n] = '1'
				break
print(''.join(p))


n = int(input())
x = input()
lst = []
for i in range(10):
	lst.append(i)
for i in x:
	if i == 'L':
		lst.remove(min(lst))
	elif i == 'R':
		lst.remove(max(lst))
	else:
		lst.append(int(i))
		lst.sort()
for i in range(10):
	if i in lst:
		print('0', end='')
	else:
		print('1', end='')


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


n = int(input())
arr = list(input())
hotelArr = [0] * 10
for i in arr:
	if i == 'L':
		left = 0
		while hotelArr[left] != 0:
			left += 1
		hotelArr[left] = 1
	elif i == 'R':
		right = 9
		while hotelArr[right] != 0:
			right -= 1
		hotelArr[right] = 1
	else:
		hotelArr[int(i)] = 0
print(*hotelArr, sep='')


n = int(input())
st = str(input())
i = 0
s = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
for i in range(len(st)):
	if st[i] == 'L':
		for j in range(len(s)):
			if s[j] == '0':
				s[j] = '1'
				break
	elif st[i] == 'R':
		for l in reversed(range(len(s))):
			if s[l] == '0':
				s[l] = '1'
				break
	else:
		s[int(st[i])] = '0'
print(''.join(map(str, s)))


N = int(input())
S = input()
list1 = [0] * 10
for i in S:
	if i == 'L':
		for j in range(10):
			if list1[j] == 0:
				list1[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if list1[j] == 0:
				list1[j] = 1
				break
	else:
		list1[int(i)] = 0
for k in list1:
	print(k, end='')


import math
n = int(input())
a = list(input())
b = []
for i in range(10):
	b.append(0)
for i in range(n):
	if a[i] == 'L':
		for j in range(10):
			if b[j] == 1:
				continue
			else:
				b[j] = 1
				break
	elif a[i] == 'R':
		for j in range(9, -1, -1):
			if b[j] == 1:
				continue
			else:
				b[j] = 1
				break
	else:
		b[int(a[i])] = 0
for i in range(10):
	print(b[i], end='')


n = int(input())
events = input()
events = list(events)
rooms = [0] * 10
for event in events:
	if event is 'L':
		for roomNo in range(10):
			if rooms[roomNo] == 0:
				rooms[roomNo] = 1
				break
	elif event is 'R':
		for roomNo in range(9, -1, -1):
			if rooms[roomNo] == 0:
				rooms[roomNo] = 1
				break
	else:
		rooms[int(event)] = 0
print(''.join(map(str, rooms)))


n = int(input())
s = input()
a = [0] * 10
for i in range(n):
	if s[i] == 'L':
		for i in range(10):
			if a[i] == 0:
				a[i] = 1
				break
		continue
	if s[i] == 'R':
		for i in range(9, -1, -1):
			if a[i] == 0:
				a[i] = 1
				break
		continue
	a[int(s[i])] = 0
print(''.join((str(e) for e in a)))


a = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
n = int(input())
s = input()
for i in s:
	if i == 'L':
		for j in range(0, 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'
p = ''.join(a)
print(p)


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


def calc():
	print()

def main():
	_: int = int(input())
	arr: list = [0 for _ in range(10)]
	log: str = input().strip()
	for i in log:
		if i == 'L':
			for j in range(0, 10):
				if arr[j] == 0:
					arr[j] = 1
					break
		elif i == 'R':
			for j in reversed(range(0, 10)):
				if arr[j] == 0:
					arr[j] = 1
					break
		else:
			arr[int(i)] = 0
	for i in arr:
		print(i, end='')
	print()
main()


n = int(input())
a = input()
x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
	if a[i] == 'L':
		for i in range(10):
			if x[i] == 0:
				x[i] = 1
				break
	elif a[i] == 'R':
		for i in range(1, 11):
			if x[-i] == 0:
				x[-i] = 1
				break
	else:
		x[int(a[i])] = 0
print(*x, sep='')


n = int(input())
rooms = [0 for _ in range(10)]
steps = input()
for c in steps:
	if c == 'L':
		rooms[rooms.index(0)] = 1
	elif c == 'R':
		for x in range(9, -1, -1):
			if rooms[x] == 0:
				rooms[x] = 1
				break
	else:
		rooms[int(c)] = 0
print(''.join((str(x) for x in rooms)))


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='')


def check(char, s):
	if char is 'L':
		for ind in range(len(s)):
			if s[ind] == '1':
				continue
			else:
				s = s[:ind] + '1' + s[ind + 1:]
				break
	elif char is 'R':
		for ind in reversed(range(len(s))):
			if s[ind] == '1':
				continue
			else:
				s = s[:ind] + '1' + s[ind + 1:]
				break
	else:
		room_number = int(char)
		s = s[:room_number] + '0' + s[room_number + 1:]
	return s
n = int(input())
s = input()
final_string = ''.join([str(0) for _ in range(10)])
for char in s:
	final_string = check(char, final_string)
print(final_string)


import sys
input = lambda : sys.stdin.readline().strip()
from math import gcd
from heapq import *
n = int(input())
res = ['0'] * 10
s = input()
for i in s:
	if i == 'L':
		for j in range(10):
			if res[j] == '0':
				res[j] = '1'
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if res[j] == '0':
				res[j] = '1'
				break
	else:
		res[int(i)] = '0'
print(''.join(res))


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


n = int(input())
s = input()
answer = []
for i in range(10):
	answer.append('0')
for i in range(0, len(s)):
	if s[i] == 'L':
		for j in range(10):
			if answer[j] == '0':
				answer[j] = '1'
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if answer[j] == '0':
				answer[j] = '1'
				break
	else:
		answer[int(s[i])] = '0'
Str = ''.join(answer)
print(Str)


from typing import List
Hotel = []
for i in range(10):
	Hotel.append(0)
int(input())
p = [i for i in input()]
for i in range(len(p)):
	if p[i] == 'L':
		x = 0
		while Hotel[x] == 1:
			x = x + 1
		Hotel[x] = 1
	elif p[i] == 'R':
		x = 9
		while Hotel[x] == 1:
			x = x - 1
		Hotel[x] = 1
	else:
		Hotel[int(p[i])] = 0
for i in range(len(Hotel)):
	print(Hotel[i], end='')


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


import itertools

def input_ints():
	return list(map(int, input().split()))

def output_list(v):
	print(' '.join((str(x) for x in v)))

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


n = int(input())
x = list(map(str, input()))
hotel = [0] * 10
for i in range(n):
	if x[i] == 'L':
		hotel[hotel.index(0)] = 1
	elif x[i] == 'R':
		hotel.reverse()
		hotel[hotel.index(0)] = 1
		hotel.reverse()
	else:
		hotel[int(x[i])] = 0
print(*hotel, sep='')


import sys
input = sys.stdin.readline
n = int(input())
S = input()
rooms = [0] * 10

def iterateLeft():
	for i in range(10):
		if rooms[i] == 0:
			rooms[i] = 1
			break

def iterateRight():
	for i in range(9, -1, -1):
		if rooms[i] == 0:
			rooms[i] = 1
			break
for c in S:
	if c == 'L':
		iterateLeft()
	elif c == 'R':
		iterateRight()
	elif c == '\n':
		pass
	else:
		num = int(c)
		rooms[num] = 0
rooms = [str(room) for room in rooms]
print(''.join(rooms))


s = input()
s = input()
rooms = '0' * 10
for i in s:
	if i == 'L':
		rooms = rooms[:rooms.find('0')] + '1' + rooms[rooms.find('0') + 1:]
	elif i == 'R':
		rooms = rooms[::-1]
		rooms = rooms[:rooms.find('0')] + '1' + rooms[rooms.find('0') + 1:]
		rooms = rooms[::-1]
	else:
		i = int(i)
		rooms = rooms[:i] + '0' + rooms[i + 1:]
print(rooms)


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


n = int(input())
a = input()
rooms = [0] * 10
for c in a:
	if c == 'L':
		for (i, val) in enumerate(rooms):
			if val == 0:
				rooms[i] = 1
				break
	elif c == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	else:
		rooms[int(c)] = 0
print(''.join((str(d) for d in rooms)))


import math

class Read:

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	n = Read.int()
	s = input()
	k = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
	for i in s:
		if i == 'L':
			for j in range(10):
				if k[j] == '0':
					k[j] = '1'
					break
		elif i == 'R':
			for j in range(9, -1, -1):
				if k[j] == '0':
					k[j] = '1'
					break
		else:
			k[int(i)] = '0'
	print(''.join(k))
query_count = 1
for j in range(query_count):
	solve()


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


L = 10 * [0]
n = int(input())
B = input()
F = list(B)
for i in range(0, n):
	A = F[i]
	if A == 'L':
		L[L.index(0)] = 1
	if A == 'R':
		L.reverse()
		L[L.index(0)] = 1
		L.reverse()
	if A != 'L' and A != 'R':
		L[int(A, 10)] = 0
for i in range(0, 10):
	print(L[i], end='')


string = ''
output = [0] * 10
no_events = input()
events = input()
for i in range(int(no_events)):
	if events[i] == 'L':
		for j in range(10):
			if output[j] == 0:
				output[j] = 1
				break
	elif events[i] == 'R':
		for j in range(9, -1, -1):
			if output[j] == 0:
				output[j] = 1
				break
	else:
		output[int(events[i])] = 0
for i in output:
	string += str(i)
print(string)


def getindex_left(seq):
	for i in range(10):
		if seq[i] == '0' or seq[i] == 0:
			return i
		else:
			continue

def getindex_right(seq):
	for i in range(9, -1, -1):
		if seq[i] == '0' or seq[i] == 0:
			return i
		else:
			continue
t = int(input())
string = str(input())
seq = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
for i in string:
	if i == 'L':
		index = getindex_left(seq)
		seq[index] = 1
	elif i == 'R':
		index = getindex_right(seq)
		seq[index] = 1
	else:
		seq[int(i)] = 0
for i in seq:
	print(i, end='')


n = int(input())
s = input()
haha = ['0' for i in range(10)]
for i in range(n):
	if s[i] == 'L':
		x = haha.index('0')
		haha[x] = '1'
	elif s[i] == 'R':
		x = 9 - haha[::-1].index('0')
		haha[x] = '1'
	else:
		haha[int(s[i])] = '0'
new = ''
for i in haha:
	new += i
print(new)


n = int(input())
events = input()
rooms = [0] * 10
for e in events:
	if e == 'L':
		for i in range(n):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	elif e == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	else:
		rooms[int(e)] = 0
string = ''
for r in rooms:
	string += str(r)
print(string)


input()
l1 = [0] * 10
b = input()
for i in b:
	if i == 'L':
		l1[l1.index(0)] = 1
	elif i == 'R':
		l1 = l1[::-1]
		l1[l1.index(0)] = 1
		l1 = l1[::-1]
	else:
		l1[int(i)] = 0
print(''.join(map(str, l1)))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]

def YES():
	print('YES')

def NO():
	print('NO')

def Yes():
	print('Yes')

def No():
	print('No')
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

def solve():
	n = N()
	s = inp()
	ar = [0] * 10
	for i in range(n):
		if s[i] == 'L':
			for i in range(10):
				if ar[i] == 0:
					ar[i] = 1
					break
		elif s[i] == 'R':
			for i in range(9, -1, -1):
				if ar[i] == 0:
					ar[i] = 1
					break
		else:
			k = int(s[i])
			ar[k] = 0
	s = ''
	for i in ar:
		s += str(i)
	print(s)
solve()


import sys
data = sys.stdin.readlines()
counter = 0
for line in data[1:]:
	events = list(line.rstrip())
rooms = [0] * 10
for e in events:
	if e == 'L':
		i = 0
		while rooms[i] == 1:
			i += 1
		rooms[i] = 1
	elif e == 'R':
		i = 9
		while rooms[i] == 1:
			i -= 1
		rooms[i] = 1
	else:
		rooms[int(e)] = 0
ans = ''.join(map(str, rooms))
print(ans)


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


n = int(input())
assign = [0] * 10
st = input().strip()
for x in st:
	if x == 'L':
		assign[assign.index(0)] = 1
	elif x == 'R':
		i = len(assign) - 1 - assign[::-1].index(0)
		assign[i] = 1
	else:
		assign[int(x)] = 0
for x in assign:
	print(x, end='')


n = int(input())
operation = str(input())
room = 10 * [0]
for j in range(n):
	if operation[j] == 'L':
		for k in range(10):
			if room[k] == 0:
				room[k] = 1
				break
	elif operation[j] == 'R':
		for k in range(9, -1, -1):
			if room[k] == 0:
				room[k] = 1
				break
	else:
		room[int(operation[j])] = 0
for j in range(10):
	print(end=str(room[j]))
print()


rooms = [0] * 10
n = int(input())
people = input()
min_right = 9
min_left = 0
for p in people:
	if p == 'R':
		rooms[min_right] = 1
	elif p == 'L':
		rooms[min_left] = 1
	else:
		rooms[int(p)] = 0
	for i in range(9, -1, -1):
		if rooms[i] == 0:
			min_right = i
			break
	for i in range(0, 10):
		if rooms[i] == 0:
			min_left = i
			break
x = ''
for i in rooms:
	x += str(i)
print(x)


room = []
num = int(input())
enter_exit = input()
for i in range(10):
	room.append(0)
for i in range(num):
	if enter_exit[i] == 'L':
		for j in range(10):
			if room[j] == 0:
				room[j] = 1
				break
	elif enter_exit[i] == 'R':
		for j in range(9, -1, -1):
			if room[j] == 0:
				room[j] = 1
				break
	else:
		room[int(enter_exit[i])] = 0
for i in range(10):
	print(room[i], end='')


n = int(input())
l = input()
k = ['0'] * 10
h = 0
while h < n:
	f = 0
	if l[h] == 'L':
		for f in range(10):
			if k[f] == '0':
				k[f] = '1'
				break
	elif l[h] == 'R':
		for f in range(9, -1, -1):
			if k[f] == '0':
				k[f] = '1'
				break
	else:
		k[int(l[h])] = '0'
	h += 1
print(''.join(k))


n = int(input())
rooms = [0] * 10
moves = input()
for move in moves:
	if move == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	elif move == 'L':
		for i in range(10):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	else:
		rooms[int(move)] = 0
for i in rooms:
	print(i, end='')


rooms = {0: False, 1: False, 2: False, 3: False, 4: False, 5: False, 6: False, 7: False, 8: False, 9: False}

def search_empty_room(enter):
	if enter == 'left':
		for i in range(0, 10):
			if not rooms[i]:
				return i
		return 0
	elif enter == 'right':
		for i in reversed(range(0, 10)):
			if not rooms[i]:
				return i
		return 9
n = int(input())
events = input()
last_left_room = 0
last_right_room = 9
for event in events:
	if event == 'L':
		rooms[search_empty_room('left')] = True
	elif event == 'R':
		rooms[search_empty_room('right')] = True
	else:
		rooms[int(event)] = False

def gen_str(room):
	if rooms[room]:
		return '1'
	return '0'
r = [gen_str(room) for room in rooms]
print(''.join(r))


m = int(input())
p = []
p = list(input())
r = [0] * 10
for i in range(0, len(p)):
	if p[i] == 'L':
		j = 0
		while j < 10:
			if r[j] == 0:
				r[j] = 1
				break
			else:
				j += 1
	elif p[i] == 'R':
		j = 9
		while j >= 0:
			if r[j] == 0:
				r[j] = 1
				break
			else:
				j -= 1
	else:
		r[int(p[i])] = 0
	i += 1
for u in range(len(r)):
	print(r[u], end='')


def hotel(string):
	values = ['0'] * 10
	for i in range(len(string)):
		if string[i] == 'L':
			for i in range(len(values)):
				if values[i] == '0':
					values[i] = '1'
					break
		elif string[i] == 'R':
			for j in range(len(values) - 1, -1, -1):
				if values[j] == '0':
					values[j] = '1'
					break
		elif int(string[i]) >= 0 and int(string[i]) <= 9:
			values[int(string[i])] = '0'
	return ''.join(values)
n = int(input())
string = input()
print(hotel(string))


int(input())
hotel = '0' * 10
events = input()
for e in events:
	if e == 'R':
		ind = hotel.rfind('0')
		w = '1'
	elif e == 'L':
		ind = hotel.find('0')
		w = '1'
	else:
		ind = int(e)
		w = '0'
	hotel = hotel[:ind] + w + hotel[ind + 1:]
print(hotel)


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())
a = input()
s = [0] * 10
for i in range(len(a)):
	if a[i] == 'L':
		for j in range(10):
			if s[j] == 0:
				s[j] = 1
				break
	elif a[i] == 'R':
		for j in range(10)[::-1]:
			if s[j] == 0:
				s[j] = 1
				break
	else:
		num = int(a[i])
		s[num] = 0
print(''.join(map(str, s)))


def findRoom(side, rooms):
	if side == 'L':
		for i in range(0, 10):
			if rooms[i] == 0:
				return i
	else:
		for i in range(9, -1, -1):
			if rooms[i] == 0:
				return i
	return -1

def main():
	n = int(input())
	log = input()
	rooms = [0 for i in range(10)]
	for i in log:
		if i == 'L':
			access = findRoom(i, rooms)
			if access != -1:
				rooms[access] = 1
		elif i == 'R':
			access = findRoom(i, rooms)
			if access != -1:
				rooms[access] = 1
		else:
			rooms[int(i)] = 0
	for i in range(10):
		if i == 9:
			print(rooms[i])
		else:
			print(rooms[i], end='')
	return
main()


room = [0] * 10

def addR():
	global room
	for i in range(9, -1, -1):
		if room[i] == 0:
			room[i] = 1
			break

def addL():
	global room
	for i in range(0, 10, 1):
		if room[i] == 0:
			room[i] = 1
			break
n = input()
s = input()
for event in s:
	if event == 'R':
		addR()
	elif event == 'L':
		addL()
	else:
		room[int(event)] = 0
for i in room:
	print(i, end='')


n = int(input())
s = input()
lst = [0] * 10
for i in s:
	if i == 'L':
		lst[lst.index(0)] = 1
	elif i == 'R':
		lst[-list(reversed(lst)).index(0) - 1] = 1
	else:
		lst[int(i)] = 0
print(*lst, sep='')


input()
a = input()
s = ['0'] * 10
for i in a:
	if i >= '0' and i <= '9':
		s[int(i)] = '0'
	elif i == 'L':
		j = 0
		while s[j] != '0':
			j += 1
		s[j] = '1'
	else:
		j = 9
		while s[j] != '0':
			j -= 1
		s[j] = '1'
print(''.join(s))


def main():
	n = int(input())
	s = input()
	arr = [0 for i in range(10)]
	left = 0
	right = 0
	for i in s:
		if i == 'L':
			left = 0
			while left < 10:
				if arr[left] == 0:
					arr[left] = 1
					break
				else:
					left += 1
		elif i == 'R':
			right = 9
			while right > -1:
				if arr[right] == 0:
					arr[right] = 1
					break
				else:
					right -= 1
		elif i.isdigit():
			arr[int(i)] = 0
	for i in range(len(arr)):
		print(arr[i], end='')
main()


def str_list(s, char):
	output_list = []
	collector = ''
	for i in range(len(s)):
		if s[i] == char:
			if collector:
				output_list.append(int(collector))
				collector = ''
		else:
			collector += s[i]
	output_list.append(int(collector))
	return output_list

def merge_sort(l):

	def merge(l_1, l_2):
		(i, j) = (0, 0)
		output_list = []
		while i < len(l_1) and j < len(l_2):
			if l_1[i][0] < l_2[j][0]:
				output_list.append(l_1[i])
				i += 1
			else:
				output_list.append(l_2[j])
				j += 1
		if i == len(l_1):
			output_list += l_2[j:]
		elif j == len(l_2):
			output_list += l_1[i:]
		return output_list

	def sorts(l):
		if len(l) < 2:
			return l
		else:
			mid = len(l) // 2
			left = sorts(l[:mid])
			right = sorts(l[mid:])
		return merge(left, right)
	return sorts(l)

def merge_sort2(l):

	def merge(l_1, l_2):
		(i, j) = (0, 0)
		output_list = []
		while i < len(l_1) and j < len(l_2):
			if l_1[i][1] < l_2[j][1]:
				output_list.append(l_1[i])
				i += 1
			else:
				output_list.append(l_2[j])
				j += 1
		if i == len(l_1):
			output_list += l_2[j:]
		elif j == len(l_2):
			output_list += l_1[i:]
		return output_list

	def sorts(l):
		if len(l) < 2:
			return l
		else:
			mid = len(l) // 2
			left = sorts(l[:mid])
			right = sorts(l[mid:])
		return merge(left, right)
	return sorts(l)

def str_list_with_str(s, char):
	output_list = []
	collector = ''
	for i in range(len(s)):
		if s[i] == char:
			if collector:
				output_list.append(collector)
				collector = ''
		else:
			collector += s[i]
	output_list.append(collector)
	return output_list

def list_str(l, char):
	output_str = ''
	for i in range(len(l) - 1):
		output_str += str(l[i]) + char
	output_str += str(l[len(l) - 1])
	return output_str

def find_max(l, i, current_max):
	if i == len(l):
		return current_max
	else:
		if current_max < l[i]:
			current_max = l[i]
		return find_max(l, i + 1, current_max)

def simple_find_min_max(l):
	current_max = l[0]
	current_min = l[0]
	for i in l:
		if current_max < i:
			current_max = i
		if current_min > i:
			current_min = i
	return (current_min, current_max)

def simple_find_min(l):
	current_max = l[0]
	for i in l:
		if current_max > i:
			current_max = i
	return current_max

def sum(l):
	sum = 0
	for i in l:
		sum += i
	return sum

def count_1_0(s, char):
	count_1 = 0
	for i in s:
		if i == char:
			count_1 += 1
	return count_1

def maxi(c1, c2):
	if c1 > c2:
		return c1
	return c2

def mini(c1, c2):
	if c1 < c2:
		return c1
	return c2

def find_power(n):
	power = 0
	while n >= 2 ** power:
		power += 1
	return power - 1

def dec_to_binary(n):
	output_str = ''
	power = find_power(n)
	for p in range(power + 1):
		i = power - p
		element = n // 2 ** i
		output_str += str(element)
		n -= 2 ** i * element
	return output_str

def binary_to_dec(string):
	sum = 0
	for i in range(len(string)):
		current_power = len(string) - 1 - i
		sum += 2 ** current_power * int(string[i])
	return sum

def or_operation(s1, s2):
	if len(s1) > len(s2):
		s2 = '0' * (len(s1) - len(s2)) + s2
	elif len(s2) > len(s1):
		s1 = '0' * (len(s2) - len(s1)) + s1
	output_str = ''
	for i in range(len(s1)):
		if s1[i] == '1' or s2[i] == '1':
			output_str += '1'
		else:
			output_str += '0'
	return output_str

def or_op_for_dec(n, m):
	binary_n = dec_to_binary(n)
	binary_m = dec_to_binary(m)
	or_result = or_operation(binary_m, binary_m)
	return binary_to_dec(or_result)

def left_entry(l):
	for i in range(10):
		if l[i] == 0:
			l[i] = 1
			break

def right_entry(l):
	for i in range(10):
		j = 9 - i
		if l[j] == 0:
			l[j] = 1
			break

def leave(input_str, l):
	input = int(input_str)
	l[input] = 0

def main_function():
	test_cases = range(int(input()))
	room_list = [0 for i in range(10)]
	stri = input()
	for i in range(len(stri)):
		if stri[i] == 'L':
			left_entry(room_list)
		elif stri[i] == 'R':
			right_entry(room_list)
		else:
			leave(stri[i], room_list)
	return list_str(room_list, '')
print(main_function())


x = int(input())
y = input()
t = '0000000000'
m = [l for l in t]
z = [d for d in y]
for num in z:
	if num == 'L':
		i = 0
		while m[i] == '1':
			i = i + 1
		m[i] = '1'
	elif num == 'R':
		j = 1
		while m[-j] == '1':
			j = j + 1
		m[-j] = '1'
	else:
		m[int(num)] = '0'
w = ''
for zum in m:
	w = w + str(zum)
print(w)


n = int(input())
s = str(input())
a = []
for j in range(10):
	a.append(0)
for i in s:
	if i == 'L' or i == 'R':
		if i == 'L':
			p = a.index(0)
			a[p] = 1
		elif i == 'R':
			a.reverse()
			p = a.index(0)
			a[p] = 1
			a.reverse()
	elif i == '0':
		a[0] = 0
	elif i == '1':
		a[1] = 0
	elif i == '2':
		a[2] = 0
	elif i == '3':
		a[3] = 0
	elif i == '4':
		a[4] = 0
	elif i == '5':
		a[5] = 0
	elif i == '6':
		a[6] = 0
	elif i == '7':
		a[7] = 0
	elif i == '8':
		a[8] = 0
	elif i == '9':
		a[9] = 0
for i in range(len(a)):
	print(a[i], end='')


from math import *
from collections import *
from itertools import *
from functools import *
from random import *

def getl(t=int):
	return [t(x) for x in input().split()]

def get(t=int):
	return t(input())
alphabet = [chr(x) for x in range(ord('a'), ord('z') + 1)]
alnum = lambda x: ord(x) - ord('a')
a = [0] * 10

def main():
	n = get()
	instr = input()
	for i in instr:
		if i == 'L':
			L()
		elif i == 'R':
			R()
		else:
			a[int(i)] -= 1
	print(''.join((str(x) for x in a)))

def L():
	for i in range(10):
		if a[i] == 0:
			a[i] = 1
			return

def R():
	for j in range(10):
		i = 10 - j - 1
		if a[i] == 0:
			a[i] = 1
			return
main()


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


def main():
	n = int(input())
	s = input()
	ans = 0
	for i in s:
		if i == 'L':
			j = 9
			while j >= 0:
				if ans & 1 << j == 0:
					ans |= 1 << j
					break
				j -= 1
		elif i == 'R':
			j = 0
			while j < 10:
				if ans & 1 << j == 0:
					ans |= 1 << j
					break
				j += 1
		else:
			ans &= ~(1 << 9 - int(i))
	ret = ''
	while ans > 0:
		ret += str(ans % 2)
		ans //= 2
	while len(ret) != 10:
		ret += '0'
	print(ret[::-1])
main()


k = int(input())
a = list(input())
b = [0] * 10
c = 0
d = ''
for i in a:
	if i == 'L':
		c = b.index(0)
		b[c] = 1
	elif i == 'R':
		d = b[::-1]
		c = d.index(0)
		b[9 - c] = 1
	else:
		b[ord(i) - ord('0')] = 0
b = ''.join((str(i) for i in b))
print(b)


n = int(input())
s = input()
rooms = [0] * 10
for x in list(s):
	if x == 'L':
		for y in range(10):
			if rooms[y] == 0:
				rooms[y] = 1
				break
	elif x == 'R':
		for y in range(-1, -11, -1):
			if rooms[y] == 0:
				rooms[y] = 1
				break
	else:
		rooms[int(x)] = 0
rooms = [str(v) for v in rooms]
print(''.join(rooms))


def hotelier(arr, s):
	for i in range(len(s)):
		if ord(s[i]) in range(ord('0'), ord('9') + 1):
			arr[int(s[i])] = '0'
		elif s[i] == 'L':
			for j in range(len(arr)):
				if arr[j] == '0':
					arr[j] = '1'
					break
		elif s[i] == 'R':
			for k in range(len(arr) - 1, -1, -1):
				if arr[k] == '0':
					arr[k] = '1'
					break
	return ''.join(arr)
t = int(input())
s = input().rstrip().lstrip()
arr = ['0'] * 10
print(hotelier(arr, s))


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n,) = I()
s = input()
l = [0] * 10
for i in s:
	if i == 'L':
		for i in range(10):
			if l[i] == 0:
				l[i] = 1
				break
	elif i == 'R':
		for i in range(9, -1, -1):
			if l[i] == 0:
				l[i] = 1
				break
	else:
		k = int(i)
		l[k] = 0
print(*l, sep='')


n = int(input())
s = input()
left = 0
right = 9
rooms = [False] * 10
for i in s:
	if i == 'L':
		for x in range(0, 10):
			if rooms[x] == False:
				rooms[x] = True
				break
	elif i == 'R':
		for x in range(9, -1, -1):
			if rooms[x] == False:
				rooms[x] = True
				break
	else:
		rooms[int(i)] = False
for i in range(0, 10):
	print(int(rooms[i]), end='')


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


n = int(input())
string = input()
array = [0] * 10
for i in string:
	left = 0
	right = 9
	if i == 'L':
		while array[left] == 1:
			left += 1
		array[left] = 1
	elif i == 'R':
		while array[right] == 1:
			right -= 1
		array[right] = 1
	else:
		array[int(i)] = 0
for i in range(len(array)):
	print(array[i], end='')


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


def first_left(str):
	i = 0
	while str[i] != 0:
		i += 1
	return i

def first_right(str):
	i = 9
	while str[i] != 0:
		i -= 1
	return i
hotel = [0] * 10
num = int(input())
logs = input()
for log in logs:
	if log == 'L':
		hotel[first_left(hotel)] = 1
	elif log == 'R':
		hotel[first_right(hotel)] = 1
	else:
		hotel[int(log)] = 0
for room in hotel:
	print(room, end='')


n = int(input())
s = input()
h = [0 for i in range(10)]
for i in s:
	if i == 'L':
		f = h.index(0)
		h[f] = 1
	elif i == 'R':
		f = abs(h[::-1].index(0) - 9)
		h[f] = 1
	else:
		h[int(i)] = 0
print(*h, sep='')


n = int(input())
stat = input()
l = [0 for i in range(10)]
openRooms = [i for i in range(10)]
for i in range(n):
	if stat[i] == 'L':
		l[openRooms[0]] = 1
		openRooms.pop(0)
	elif stat[i] == 'R':
		l[openRooms[-1]] = 1
		openRooms.pop()
	else:
		l[int(stat[i])] = 0
		openRooms.append(int(stat[i]))
		openRooms.sort()
for i in range(10):
	print(str(l[i]), end='')


n = int(input())
line = input()
lst = [0 for i in range(10)]
for ch in line:
	if ch == 'L':
		for i in range(10):
			if lst[i] == 0:
				lst[i] = 1
				break
	elif ch == 'R':
		for i in range(9, -1, -1):
			if lst[i] == 0:
				lst[i] = 1
				break
	else:
		lst[int(ch)] = 0
print(*lst, sep='')


n = int(input())
x = str(input())
l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
	if x[i] == 'L':
		l[l.index(0)] = 1
	elif x[i] == 'R':
		for j in range(-1, -n - 1, -1):
			if l[j] == 0:
				k = j
				break
		l[k] = 1
	elif (x[i] == p for p in range(9)):
		l[int(x[i])] = 0
print(*l, sep='')


def hotel(n, s):
	result = [0] * 10
	for i in range(n):
		if s[i] == 'L':
			for j in range(10):
				if not result[j]:
					result[j] += 1
					break
		elif s[i] == 'R':
			for j in range(9, -1, -1):
				if not result[j]:
					result[j] += 1
					break
		else:
			result[ord(s[i]) - ord('0')] -= 1
	answer = [str(i) for i in result]
	return ''.join(answer)
m = int(input())
t = input()
print(hotel(m, t))


hotel = [0] * 10
(l, r) = (0, 9)
input()
for i in input():
	if i == 'L':
		idx = 0
		while 1:
			if hotel[idx] == 0:
				hotel[idx] = 1
				break
			idx += 1
	elif i == 'R':
		idx = 9
		while 1:
			if hotel[idx] == 0:
				hotel[idx] = 1
				break
			idx -= 1
	else:
		hotel[int(i)] = 0
print(*hotel, sep='')


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


(n, events) = (int(input()), input())
rooms = [0] * 10
for e in events:
	if e == 'L':
		for i in range(10):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	elif e == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	else:
		idx = int(float(e))
		rooms[idx] = 0
rooms_ = [str(c) for c in rooms]
print(''.join(rooms_))


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()
r = ['0' for i in range(10)]
for x in s:
	if x == 'L':
		i = 0
		while r[i] != '0':
			i += 1
		r[i] = '1'
	elif x == 'R':
		i = 9
		while r[i] != '0':
			i -= 1
		r[i] = '1'
	else:
		r[int(x)] = '0'
print(''.join(r))


def find_place(hotel, side):
	if side == 'L':
		for i in range(10):
			if hotel[i] == 0:
				hotel[i] = 1
				break
	else:
		for i in range(9, -1, -1):
			if hotel[i] == 0:
				hotel[i] = 1
				break
n = int(input())
actions = str(input())
hotel = [0] * 10
for i in range(n):
	if actions[i] == 'L' or actions[i] == 'R':
		find_place(hotel, actions[i])
	else:
		hotel[int(actions[i])] = 0
print(*hotel, sep='')


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)))


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


def left():
	global s
	for i in range(len(s)):
		if s[i] == '0':
			s[i] = '1'
			return

def right():
	global s
	for i in range(len(s) - 1, -1, -1):
		if s[i] == '0':
			s[i] = '1'
			return

def leave(n):
	global s
	s[n] = '0'
	return
n = int(input())
t = input()
s = ['0'] * 10
for i in t:
	if i == 'L':
		left()
	elif i == 'R':
		right()
	else:
		leave(int(i))
print(''.join(s))


rooms = [None] * 10

def fill_left():
	global rooms
	for i in range(10):
		if rooms[i] is None:
			rooms[i] = '1'
			return

def fill_right():
	global rooms
	for i in range(10):
		if rooms[9 - i] is None:
			rooms[9 - i] = '1'
			return

def leave(num):
	global rooms
	rooms[num] = None
n = int(input())
com = input()
for c in com:
	if c == 'L':
		fill_left()
	elif c == 'R':
		fill_right()
	else:
		leave(int(c))
print(''.join(['1' if rooms[i] is not None else '0' for i in range(10)]))


n = int(input())
s = input()
l = [0] * 10
i = 0
while i < len(s):
	if ord(s[i]) >= 48 and ord(s[i]) <= 57:
		l[ord(s[i]) - 48] = 0
	elif s[i] == 'L':
		for j in range(0, 10):
			if l[j] == 0:
				l[j] = 1
				break
	else:
		for j in range(9, -1, -1):
			if l[j] == 0:
				l[j] = 1
				break
	i += 1
q = ''
for i in l:
	q = q + str(i)
print(q)


n = int(input())
res = list('0' * 10)
li = list(input())
for i in li:
	if i == 'L':
		for (index, i) in enumerate(res):
			if i == '0':
				res[index] = '1'
				break
	elif i == 'R':
		for (index, i) in enumerate(reversed(res)):
			if i == '0':
				index = 0 - (index + 1)
				res[index] = '1'
				break
	else:
		res[int(i)] = '0'
print(''.join(res))


l = int(input())
actions = input()
rooms = [False] * 10
for action in actions:
	if action.isdigit():
		rooms[int(action)] = False
	elif action == 'L':
		i = 0
		while rooms[i]:
			i += 1
		rooms[i] = True
	elif action == 'R':
		i = 9
		while rooms[i]:
			i -= 1
		rooms[i] = True
print(*[int(el) for el in rooms], sep='')


n = int(input())
l = [0 for _ in range(10)]
s = input()
for i in range(n):
	if s[i] == 'L':
		(j, z) = (0, True)
		while j < 10 and z:
			if l[j] == 0:
				z = False
			else:
				j += 1
		l[j] += 1
	if s[i] == 'R':
		(j, z) = (9, True)
		while j >= 0 and z:
			if l[j] == 0:
				z = False
			else:
				j -= 1
		l[j] += 1
	if 48 <= ord(s[i]) <= 57:
		l[int(s[i])] -= 1
print(''.join((str(x) for x in l)))


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


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


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


n = int(input())
memory = input()
rooms_status = 10 * [0]
(left, right) = (0, 9)
i = 0
while i < n:
	if memory[i] == 'L':
		rooms_status[left] = 1
		find_left = left + 1
		while find_left <= 9 and rooms_status[find_left] != 0:
			find_left += 1
		left = find_left
		if left == 10:
			right = -1
	elif memory[i] == 'R':
		rooms_status[right] = 1
		find_right = right - 1
		while find_right >= 0 and rooms_status[find_right] != 0:
			find_right -= 1
		right = find_right
		if right == -1:
			left = 10
	else:
		if int(memory[i]) < left:
			left = int(memory[i])
		if int(memory[i]) > right:
			right = int(memory[i])
		rooms_status[int(memory[i])] = 0
	i += 1
result = ''
for i in rooms_status:
	result += str(i)
print(result)


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


rooms = [False for _ in range(10)]
n = int(input())
s = input()
for i in range(n):
	char = s[i]
	if char == 'L':
		l = 0
		while rooms[l]:
			l += 1
		rooms[l] = True
	elif char == 'R':
		r = 9
		while rooms[r]:
			r -= 1
		rooms[r] = True
	else:
		char = int(char)
		rooms[char] = False
for i in range(10):
	print(int(rooms[i]), end='')


n = int(input())
s = input()
d = [0] * 10
for i in s:
	if i == 'L':
		d[d.index(0)] = 1
	elif i == 'R':
		f = d[::-1]
		d[9 - f.index(0)] = 1
	else:
		d[int(i)] = 0
print(''.join([str(i) for i in d]))


t = int(input())
s = input()
s = list(s)
d = 0
g = 1
a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(t):
	if s[i] == 'L':
		for j in range(10):
			if a[j] == 0:
				a[j] = 1
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if a[j] == 0:
				a[j] = 1
				break
	else:
		a[int(s[i])] = 0
for i in range(10):
	print(a[i], end='')


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


def checkavaliable(room):
	i = 0
	while i < 10:
		if room[i] == 0:
			return i
		i += 1
	return 0

def checkavaliableright(room):
	i = 9
	while i >= 0:
		if room[i] == 0:
			return i
		i -= 1
	return 0
n = int(input())
assign = input()
room = [0] * 10
for i in assign:
	if i == 'L':
		index = checkavaliable(room)
		room[index] = 1
	elif i == 'R':
		index = checkavaliableright(room)
		room[index] = 1
	else:
		room[int(i)] = 0
for i in range(0, 9):
	print(room[i], end='')
print(room[9])


n = int(input())
st = input()
ans = [0] * 10
for i in range(n):
	for j in range(10):
		if st[i] == 'L' and ans[j] == 0:
			ans[j] = 1
			break
		elif st[i] == 'R' and ans[9 - j] == 0:
			ans[9 - j] = 1
			break
		elif st[i] != 'L' and st[i] != 'R':
			ans[int(st[i])] = 0
			break
s = ''
for i in ans:
	s += str(i)
print(s)


n = int(input())
arr = input()
room = ['0' for _ in range(10)]
for i in range(n):
	if arr[i] == 'L':
		for j in range(10):
			if room[j] == '0':
				room[j] = 'L'
				break
	elif arr[i] == 'R':
		j = 9
		while j >= 0:
			if room[j] == '0':
				room[j] = 'R'
				break
			j -= 1
	else:
		room[ord(arr[i]) - 48] = '0'
for i in range(10):
	if room[i] == 'L' or room[i] == 'R':
		print('1', end='')
	else:
		print('0', end='')


n = int(input())
ch = input()
b = [0] * 10
for e in ch:
	if e == 'L':
		i = b.index(0)
		b[i] = 1
	elif e == 'R':
		b.reverse()
		i = b.index(0)
		b[i] = 1
		b.reverse()
	else:
		b[int(e)] = 0
ch = ''
for e in range(10):
	ch += str(b[e])
print(ch)


t = int(input())
ar = list(map(str, input()))
arr = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
for i in ar:
	if i == 'L':
		arr[arr.index('0')] = '1'
	elif i == 'R':
		arr[9 - arr[::-1].index('0')] = '1'
	else:
		arr[int(i)] = '0'
for i in arr:
	print(i, end='')


def hotel(n, l):
	leftinc = 0
	rightdec = 9
	a = [0] * 10
	for i in l:
		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
	c = ''.join(list(map(str, a)))
	print(c)
n = int(input())
l = str(input())
hotel(n, l)


s = set(range(10))
v = [1] * 10
n = int(input())
a = input()
for i in a:
	if i == 'L':
		s.discard(min(s))
	elif i == 'R':
		s.discard(max(s))
	else:
		s.add(int(i))
for x in s:
	v[x] = 0
print(''.join(map(str, v)))


room = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
x = int(input())
i = 0
string = list(input())
while i < x:
	if string[i] == 'R':
		j = 9
		while string[i] != '2':
			if room[j] == '0':
				room[j] = '1'
				string[i] = '2'
				break
			j -= 1
	elif string[i] == 'L':
		j = 0
		while string[i] != '2':
			if room[j] == '0':
				room[j] = '1'
				string[i] = '2'
				break
			j += 1
	else:
		a = int(string[i])
		room[a] = '0'
		string[i] == '2'
	i += 1
word = ''
for i in room:
	word = word + i
print(word)


x = int(input())
z = input()
n = 0
l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
while n < x:
	s = 0
	while s < 10:
		if z[n] == 'L' and l[s] == 0:
			l[s] = 1
			break
		elif z[n] == 'R' and l[9 - s] == 0:
			l[9 - s] = 1
			break
		elif z[n] == '0' or z[n] == '1' or z[n] == '2' or (z[n] == '3') or (z[n] == '4') or (z[n] == '5') or (z[n] == '6') or (z[n] == '7') or (z[n] == '8') or (z[n] == '9'):
			l[int(z[n])] = 0
			break
		s += 1
	n += 1
h = 0
while h < 10:
	print(l[h], end='')
	h += 1


import sys
import math, bisect
sys.setrecursionlimit(10 ** 5)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict

def I():
	return int(sys.stdin.readline())

def neo():
	return map(int, sys.stdin.readline().split())

def Neo():
	return list(map(int, sys.stdin.readline().split()))
n = I()
s = input()
Ans = [0] * 10
t = [str(i) for i in range(10)]
for i in s:
	if i in t:
		Ans[int(i)] = 0
	elif i == 'L':
		for j in range(10):
			if Ans[j] == 0:
				Ans[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if Ans[j] == 0:
				Ans[j] = 1
				break
Ans = map(str, Ans)
print(''.join(Ans))


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


n = int(input())
memory = input()
left = 0
right = 9
hotel = []
for i in range(10):
	hotel.append(0)
for i in memory:
	if i == 'L':
		hotel[left] = 1
	elif i == 'R':
		hotel[right] = 1
	else:
		hotel[ord(i) - 48] = 0
	if hotel[left] == 1 or ord(i) - 48 < left:
		for j in range(10):
			if hotel[j] == 0:
				left = j
				break
	if hotel[right] == 1 or ord(i) - 48 > right:
		for j in range(9, -1, -1):
			if hotel[j] == 0:
				right = j
				break
for i in range(10):
	print('{}'.format(hotel[i]), end='')


import sys
input = sys.stdin.readline
n = int(input())
used = [False] * 10
s = input().strip()
for c in s:
	if c == 'L':
		for j in range(10):
			if not used[j]:
				used[j] = True
				break
	elif c == 'R':
		for j in range(9, -1, -1):
			if not used[j]:
				used[j] = True
				break
	else:
		c = int(c)
		used[c] = False
print(*map(int, used), sep='')


def main():
	from bisect import bisect_left as bl, bisect_right as br, insort
	import sys, math
	from collections import defaultdict as dd, deque

	def data():
		return sys.stdin.readline().strip()

	def mdata():
		return list(map(int, data().split()))
	out = sys.stdout.write
	INF = float('INF')
	mod = int(1000000000.0) + 7
	n = int(data())
	l = data()
	x = [0] * 10
	for i in l:
		if i == 'L':
			for i in range(10):
				if x[i] == 0:
					x[i] = 1
					break
		elif i == 'R':
			for i in range(9, -1, -1):
				if x[i] == 0:
					x[i] = 1
					break
		else:
			x[int(i)] = 0
	print(''.join(map(str, x)))
main()


ls = []
for x in range(0, 10):
	ls.append(0)
n = int(input())
st = list(input())
for x in st:
	if x == 'L':
		ls[ls.index(0)] = 1
	elif x == 'R':
		ls[len(ls) - ls[::-1].index(0) - 1] = 1
	else:
		ls[int(x)] = 0
for t in ls:
	print(t, end='')


n = int(input())
s = input()
a = [0 for i in range(10)]

def f(a, c):
	if c == 'R':
		for i in range(len(a)):
			if a[-i - 1] == 0:
				a[-i - 1] = 1
				break
	else:
		for i in range(len(a)):
			if a[i] == 0:
				a[i] = 1
				break
	return a
for i in s:
	if i.isdigit():
		a[int(i)] = 0
	else:
		f(a, i)
print(''.join((str(e) for e in a)))


from functools import reduce
rooms = [0 for _ in range(10)]

def enter_left():
	global rooms
	i = 0
	while rooms[i]:
		i += 1
	rooms[i] = 1

def enter_right():
	global rooms
	i = 9
	while rooms[i]:
		i -= 1
	rooms[i] = 1

def exit_room(index):
	global rooms
	rooms[index] = 0

def main():
	_ = input()
	string = input()
	for char in string:
		if char == 'L':
			enter_left()
		elif char == 'R':
			enter_right()
		else:
			exit_room(int(char))
	global rooms
	result = ''
	for room in rooms:
		result += str(room)
	print(result)
main()


input()
l = [0] * 10
s = input()
for i in range(len(s)):
	e = s[i]
	if e == 'L':
		l[l.index(0)] = 1
	elif e == 'R':
		l[len(l) - l[::-1].index(0) - 1] = 1
	else:
		l[int(e)] = 0
print(*l, sep='')


import sys
n = int(sys.stdin.readline())
instruc = sys.stdin.readline()
arr = [0] * 10
for i in range(n):
	if instruc[i] == 'L':
		for j in range(10):
			if arr[j] == 0:
				arr[j] = 1
				break
	elif instruc[i] == 'R':
		for j in range(9, -1, -1):
			if arr[j] == 0:
				arr[j] = 1
				break
	else:
		pos = int(instruc[i])
		arr[pos] = 0
for i in range(10):
	arr[i] = str(arr[i])
res = ''.join(arr)
print(res)


n = int(input())
room_set = input()
room_list = [0] * 10
for i in room_set:
	if i == 'L':
		j = 0
		while room_list[j] == 1:
			j = j + 1
		room_list[j] = 1
	elif i == 'R':
		j = 9
		while room_list[j] == 1:
			j = j - 1
		room_list[j] = 1
	else:
		room_list[int(i)] = 0
output = ''
for i in room_list:
	output = output + str(i)
print(output)


n = int(input())
mem = input()
occ = [0] * 10

def get_empty_l(arr):
	for (i, v) in enumerate(arr):
		if v == 0:
			return i
	return -1

def get_empty_r(arr):
	for (i, v) in enumerate(arr[::-1]):
		if v == 0:
			return len(arr) - i - 1
	return -1
for m in mem:
	if m == 'L':
		occ[get_empty_l(occ)] = 1
	elif m == 'R':
		occ[get_empty_r(occ)] = 1
	else:
		occ[int(m)] = 0
res = ''
for o in occ:
	res += str(o)
print(res)


n = int(input())
s = input()
ans = ['0' for _ in range(10)]
for x in s:
	if x == 'L':
		for i in range(10):
			if ans[i] == '0':
				ans[i] = '1'
				break
	elif x == 'R':
		for i in reversed(range(10)):
			if ans[i] == '0':
				ans[i] = '1'
				break
	else:
		x = int(x)
		ans[x] = '0'
print(''.join(ans))


n = int(input())
s = list(input())
arr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(0, n):
	if s[i] == 'L':
		temp = arr.index(0)
		arr[temp] = 1
	elif s[i] == 'R':
		arr.reverse()
		temp = arr.index(0)
		arr[temp] = 1
		arr.reverse()
	elif s[i] == '1':
		arr[1] = 0
	elif s[i] == '2':
		arr[2] = 0
	elif s[i] == '3':
		arr[3] = 0
	elif s[i] == '4':
		arr[4] = 0
	elif s[i] == '5':
		arr[5] = 0
	elif s[i] == '6':
		arr[6] = 0
	elif s[i] == '7':
		arr[7] = 0
	elif s[i] == '8':
		arr[8] = 0
	elif s[i] == '9':
		arr[9] = 0
	elif s[i] == '0':
		arr[0] = 0
print(*arr, sep='')


def rindex(x, s):
	for i in range(len(s) - 1, -1, -1):
		if s[i] == x:
			return i

def solve(n, s):
	r = [0] * 10
	for i in s:
		if i == 'L':
			r[r.index(0)] = 1
		elif i == 'R':
			r[rindex(0, r)] = 1
		else:
			r[int(i)] = 0
	return ''.join(map(str, r))

def main():
	n = int(input())
	s = input()
	print(solve(n, s))
main()


n = int(input())
s = input()
l = [0] * 10
lfree = 0
rfree = 9
for i in s:
	if i.isdigit():
		l[int(i)] = 0
		lfree = min(int(i), lfree)
		rfree = max(int(i), rfree)
	elif i == 'L':
		for i in range(lfree, 10):
			if l[i] == 0:
				l[i] = 1
				lfree = i + 1
				break
	else:
		for j in range(rfree, -1, -1):
			if l[j] == 0:
				l[j] = 1
				rfree = j - 1
				break
for i in l:
	print(i, end='')


x = int(input())
a = input()
ar = [0] * 10
m = 0
for i in a:
	if i == 'L':
		m = ar.index(0)
		ar[m] += 1
	elif i == 'R':
		ar.reverse()
		m = ar.index(0)
		ar[m] += 1
		ar.reverse()
	else:
		j = int(i)
		ar[j] = 0
print(*ar, sep='')


n = int(input())
customer = input()
room = [0 for i in range(10)]
temp = []
l = 0
r = 9
for i in range(n):
	if customer[i] == 'L':
		if len(temp) != 0 and (temp[0] <= l or l > r):
			room[temp[0]] = 1
			temp.remove(temp[0])
		else:
			room[l] = 1
			l += 1
	elif customer[i] == 'R':
		if len(temp) != 0 and (temp[-1] >= r or l > r):
			room[temp[-1]] = 1
			temp.pop()
		else:
			room[r] = 1
			r -= 1
	else:
		temp.append(int(customer[i]))
		temp.sort()
		room[int(customer[i])] = 0
k = ''
for i in room:
	k += str(i)
print(k)


n = int(input())
string = input()
rooms = ['0' for x in range(10)]
for x in string:
	if x == 'L':
		vacant = rooms.index('0')
		rooms[vacant] = '1'
	elif x == 'R':
		vacant = rooms[::-1].index('0')
		rooms[9 - vacant] = '1'
	else:
		rooms[int(x)] = '0'
print(''.join(rooms))


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)))


def getIndexLeft(rooms):
	return rooms.index(0)

def getIndexRight(rooms):
	temp = rooms[::-1]
	return 9 - temp.index(0)
size = int(input())
mem = input()
rooms = [0] * 10
i = 0
for x in mem:
	i += 1
	if x == 'L':
		rooms[getIndexLeft(rooms)] = 1
	elif x == 'R':
		rooms[getIndexRight(rooms)] = 1
	else:
		rooms[int(x)] = 0
for _ in rooms:
	print(_, end='')


n = int(input())
log = input().strip()
r1 = [0] * 10
r2 = [0] * 10
for c in log:
	if c == 'L':
		i = r1.index(0)
		r1[i] = r2[9 - i] = 1
		continue
	if c == 'R':
		i = r2.index(0)
		r2[i] = r1[9 - i] = 1
		continue
	i = int(c)
	r1[i] = r2[9 - i] = 0
print(''.join([str(c) for c in r1]))


r = [0] * 10
input()
for c in input():
	if c > 'L':
		r[9 - r[::-1].index(0)] = 1
	elif c > '9':
		r[r.index(0)] = 1
	else:
		r[int(c)] = 0
print(*r, sep='')


n = int(input())
a = list(str(input()))
firstStack = [0, 0, 0, 0, 0]
secondStack = [0, 0, 0, 0, 0]
for i in range(n):
	if a[i] == 'L':
		j = 0
		while j < 5:
			if firstStack[j] == 0:
				break
			j += 1
		if j == 5:
			j = 0
			while j < 5:
				if secondStack[j] == 0:
					break
				j += 1
			secondStack[j] = 1
		else:
			firstStack[j] = 1
	elif a[i] == 'R':
		j = 4
		while j >= 0:
			if secondStack[j] == 0:
				break
			j -= 1
		if j == -1:
			j = 4
			while j >= 0:
				if firstStack[j] == 0:
					break
				j -= 1
			firstStack[j] = 1
		else:
			secondStack[j] = 1
	else:
		num = int(a[i])
		if num < 5:
			firstStack[num] = 0
		else:
			secondStack[num - 5] = 0
for i in range(5):
	print(firstStack[i], end='')
for i in range(5):
	print(secondStack[i], end='')


def convert(list):
	res = ''.join([str(i) for i in list])
	return res
n = int(input())
events = input()
rooms = [0] * 10
for e in events:
	if e == 'L':
		index = rooms.index(0)
		rooms[index] = 1
	elif e == 'R':
		index = ''.join(map(str, rooms)).rindex('0')
		rooms[index] = 1
	else:
		rooms[int(e)] = 0
print(convert(rooms))


def free_room(n):
	global rooms
	if n == 'L':
		for (index, i) in enumerate(rooms):
			if i == 0:
				rooms[index] += 1
				break
	elif n == 'R':
		for (index, i) in enumerate(reversed(rooms)):
			if i == 0:
				rooms[len(rooms) - 1 - index] += 1
				break
	else:
		rooms[int(n)] -= 1
n = int(input())
a = list(input())
rooms = []
for ch in range(10):
	rooms.append(0)
k = ''
for num in a:
	free_room(num)
for num1 in rooms:
	k += str(num1)
print(k)


input()
a = [0 for i in range(10)]
s = input()
for c in s:
	if c == 'R':
		i = 9
		while True:
			if a[i] == 0:
				a[i] = 1
				break
			i -= 1
	elif c == 'L':
		i = 0
		while True:
			if a[i] == 0:
				a[i] = 1
				break
			i += 1
	else:
		a[int(c)] = 0
print(''.join([str(i) for i in a]))


n = int(input())
s = input()
l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in s:
	if i == 'R':
		l.pop()
	elif i == 'L':
		l = l[1:]
	else:
		l.append(int(i))
		l.sort()
ans = ''
for i in range(10):
	if i in l:
		ans += '0'
	else:
		ans += '1'
print(ans)


n = int(input())
ev = input()
st = [0] * 10
for i in ev:
	if i == 'L':
		st[st.index(0)] = 1
	elif i == 'R':
		st[9 - st[::-1].index(0)] = 1
	else:
		i = int(i)
		st[i] = 0
print(''.join((str(e) for e in st)))


n = int(input())
rooms = '0' * 10
actions = list(input())
for action in actions:
	if action == 'L':
		rooms = rooms.replace('0', '1', 1)
	elif action == 'R':
		rooms = rooms[::-1].replace('0', '1', 1)[::-1]
	else:
		rooms = rooms[:int(action)] + '0' + rooms[int(action) + 1:]
print(rooms)


import sys

def get_single_int():
	return int(sys.stdin.readline().strip())

def get_string():
	return sys.stdin.readline().strip()

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = get_single_int()
s = get_string()
ans = ['0'] * 10
for i in s:
	if i == 'L':
		ans[ans.index('0')] = '1'
	elif i == 'R':
		for j in range(10):
			if ans[9 - j] == '0':
				ans[9 - j] = '1'
				break
	else:
		ans[int(i)] = '0'
print(''.join(ans))


n = int(input())
arr = input()
arr1 = [0] * 10
for i in range(n):
	if arr[i] == 'L':
		for j in range(0, 10):
			if arr1[j] == 0:
				arr1[j] = 1
				break
	elif arr[i] == 'R':
		for j in range(9, -1, -1):
			if arr1[j] == 0:
				arr1[j] = 1
				break
	else:
		x = int(arr[i])
		arr1[x] = 0
for i in range(0, 10):
	print(arr1[i], end='')


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)))


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())
list = [0] * 10
strr = input()
for i in strr:
	if i == 'L':
		j = 0
		while list[j] != 0:
			j += 1
		list[j] = 1
	elif i == 'R':
		j = 9
		while list[j] != 0:
			j -= 1
		list[j] = 1
	else:
		list[int(i)] = 0
print(*list, sep='')


n = int(input())
arr = [0 for i in range(10)]
s = input()
room = '0123456789'
for i in s:
	b = i in room
	if b == True:
		a = int(i)
		arr[a] = 0
	elif i == 'L':
		for j in range(10):
			if arr[j] == 0:
				arr[j] = 1
				break
	else:
		for j in range(9, -1, -1):
			if arr[j] == 0:
				arr[j] = 1
				break
for i in arr:
	print(i, end='')


memory = int(input())
string = list(input())
room = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(memory):
	if string[i] == 'L':
		for j in range(10):
			if room[j] == 0:
				room[j] = 1
				break
	elif string[i] == 'R':
		for j in range(10):
			if room[9 - j] == 0:
				room[9 - j] = 1
				break
	else:
		for j in range(10):
			if j == int(string[i]):
				room[j] = 0
				break
output = ''
for i in range(10):
	output = output + str(room[i])
print(output)


def main():
	n = int(input())
	events = input()
	L = [0] * 10
	for e in events:
		if e == 'L':
			for k in range(10):
				if not L[k]:
					L[k] = 1
					break
		elif e == 'R':
			for k in range(9, -1, -1):
				if not L[k]:
					L[k] = 1
					break
		else:
			L[int(e)] = 0
	print(''.join(map(str, L)))
main()


n = int(input())
s = str(input())
room = [0] * 10
for i in range(len(s)):
	if s[i] == 'L':
		for j in range(10):
			if room[j] == 0:
				room[j] = 1
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if room[j] == 0:
				room[j] = 1
				break
	else:
		num = int(s[i])
		room[num] = 0
for i in room:
	print(i, end='')


def leftrooms_assignment(status):
	i = 0
	while status[i] != 0:
		i += 1
	status[i] = 1
	return status

def rightrooms_assignment(status):
	i = len(status) - 1
	while status[i] != 0:
		i -= 1
	status[i] = 1
	return status
n = int(input())
rep = 0
comings_goings = input()
room_status = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
while n > rep:
	if comings_goings[rep] == 'L':
		room_status = leftrooms_assignment(room_status)
	elif comings_goings[rep] == 'R':
		room_status = rightrooms_assignment(room_status)
	else:
		empty = int(comings_goings[rep])
		room_status[empty] = 0
	rep += 1
result = ''
print(result.join(map(str, room_status)))


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


t = int(input())
s = input()
a = [0] * 10
k = 0
l = 9
for i in range(0, t):
	if s[i] == 'L':
		while a[k] == 1:
			k += 1
		a[k] = 1
		k += 1
	elif s[i] == 'R':
		while a[l] == 1:
			l -= 1
		a[l] = 1
		l -= 1
	else:
		a[ord(s[i]) - ord('0')] = 0
		if k > ord(s[i]) - ord('0'):
			k = ord(s[i]) - ord('0')
		elif l < ord(s[i]) - ord('0'):
			l = ord(s[i]) - ord('0')
for i in range(0, 10):
	print(a[i], end='')
print()


n = int(input())
s = input()
ls = [0] * 10
for i in s:
	if i == 'L':
		if sum(ls) > 0:
			ls[ls.index(0)] = 1
		else:
			ls[0] = 1
	elif i == 'R':
		if sum(ls) == 0:
			ls[-1] = 1
		else:
			x = ls[::-1]
			temp = 10 - x.index(0) - 1
			ls[temp] = 1
	else:
		ls[int(i)] = 0
ls = [str(x) for x in ls]
print(''.join(ls))


n = int(input())
s = input()
ar = ['0'] * 10
for j in s:
	if j == 'L':
		t = ar.index('0')
		ar[t] = '1'
	elif j == 'R':
		L = ''.join(ar).rindex('0')
		ar[L] = '1'
	else:
		g = int(j)
		ar[g] = '0'
print(''.join(ar))


n = int(input())
arr = [0] * 10
s = input()
for c in s:
	if c == 'L':
		for i in range(10):
			if arr[i] == 0:
				arr[i] = 1
				break
	elif c == 'R':
		j = 9
		while j >= 0:
			if arr[j] == 0:
				arr[j] = 1
				break
			j -= 1
	else:
		arr[int(c)] = 0
for i in arr:
	print(i, end='')


n = int(input())
open = list(range(10))
close = []
fr_left = 0
fr_right = 9
inp = input()
for a in inp:
	if a == 'L':
		close.append(min(open))
		open.remove(min(open))
	elif a == 'R':
		close.append(max(open))
		open.remove(max(open))
	else:
		num = int(a)
		open.append(num)
		close.remove(num)
out = ''
for el in range(10):
	if el in open:
		out += '0'
	else:
		out += '1'
print(out)


from sys import stdin

def iinput():
	return int(stdin.readline())

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
n = iinput()
s = input()
status = [0] * 10
for e in s:
	if e == 'L':
		for i in range(10):
			if status[i] == 0:
				status[i] = 1
				break
	elif e == 'R':
		for i in range(9, -1, -1):
			if status[i] == 0:
				status[i] = 1
				break
	else:
		status[int(e)] = 0
print(''.join([str(e) for e in status]))


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


n = int(input())
s = input()
reg = ['0'] * 10
for m in s:
	if m == 'L':
		for i in range(10):
			if reg[i] == '0':
				reg[i] = '1'
				break
	elif m == 'R':
		for i in reversed(range(10)):
			if reg[i] == '0':
				reg[i] = '1'
				break
	else:
		reg[int(m)] = '0'
register = ''.join(reg)
print(register)


n = int(input())
f = [False] * 10
for c in input():
	if c == 'L':
		f[f.index(False)] = True
	elif c == 'R':
		f.reverse()
		f[f.index(False)] = True
		f.reverse()
	else:
		x = int(c)
		f[x] = False
print(*map(int, f), sep='')


numOfEvents = int(input())
eventsOrder = list(input())
roomsStatus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Empty = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for item in eventsOrder:
	if item == 'L':
		roomsStatus[Empty.index(0)] = 1
		Empty[Empty.index(0)] = 1
	elif item == 'R':
		lastOccurence = len(Empty) - 1 - list(reversed(Empty)).index(0)
		roomsStatus[lastOccurence] = 1
		Empty[lastOccurence] = 1
	else:
		roomsStatus[int(item)] = 0
		Empty[int(item)] = 0
output = ''
for room in roomsStatus:
	output += str(room)
print(output)


n = int(input())
ch = input()
L = [0] * 10

def zero(L):
	for i in range(len(L)):
		if L[i] == 0:
			return i

def inverse(ch):
	ch1 = []
	for i in range(len(ch)):
		ch1 = [ch[i]] + ch1
	return ch1
for i in range(n):
	if ch[i] == 'L':
		L[zero(L)] = 1
	elif ch[i] == 'R':
		L[9 - zero(inverse(L))] = 1
	else:
		L[int(ch[i])] = 0
output = ''
for i in range(10):
	output += str(L[i])
print(output)


n = int(input())
x = [0] * 10
for c in input():
	if c == 'L':
		for i in range(10):
			if x[i] == 0:
				x[i] = 1
				break
	elif c == 'R':
		for i in range(9, -1, -1):
			if x[i] == 0:
				x[i] = 1
				break
	else:
		x[int(c)] = 0
print(*x, sep='')


n = int(input())
inp = input()
m_arr = [0] * 10
for i in inp:
	if i == 'L':
		for j in range(0, 10):
			if m_arr[j] == 0:
				m_arr[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if m_arr[j] == 0:
				m_arr[j] = 1
				break
	elif int(i) in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}:
		m_arr[int(i)] = 0
res = ''.join(map(str, m_arr))
print(res)


a = int(input())
l = input()
k = '0000000000'
for i in l:
	if i == 'L':
		k = k.replace('0', '1', 1)
	elif i == 'R':
		m = k.rfind('0')
		k = k[0:m] + '1' + k[m + 1:]
	else:
		k = k[0:int(i)] + '0' + k[int(i) + 1:]
print(k)


n = int(input())
event = input()
_hash = [0] * 10
left_count = 0
right_count = 0
_list_empty = []
for char in event:
	if '0' <= char and char <= '9':
		_hash[int(char)] = 0
	elif char == 'L':
		for i in range(0, 10):
			if _hash[i] == 0:
				_hash[i] = 1
				break
	else:
		for i in range(9, -1, -1):
			if _hash[i] == 0:
				_hash[i] = 1
				break
print(''.join([str(i) for i in _hash]))


n = int(input())
arr = ['0'] * 10
action = input()
for i in action:
	if i == 'L':
		arr[arr.index('0')] = '1'
	elif i == 'R':
		arr[9 - arr[::-1].index('0')] = '1'
	else:
		arr[int(i)] = '0'
print(''.join(arr))


x = int(input())
y = input()
a = [0] * 10
for i in range(len(y)):
	if y[i] == 'L':
		a[a.index(0)] = 1
	elif y[i] == 'R':
		a.reverse()
		a[a.index(0)] = 1
		a.reverse()
	elif y[i] != 'L' and y[i] != 'R':
		a[int(y[i])] = 0
print(*a, sep='')


Rooms = []
Rooms.append(int(0))
Rooms.append(int(0))
Rooms.append(int(0))
Rooms.append(int(0))
Rooms.append(int(0))
Rooms.append(int(0))
Rooms.append(int(0))
Rooms.append(int(0))
Rooms.append(int(0))
Rooms.append(int(0))
Memory = int(input())
EventOrder = input()
for i in range(Memory):
	if EventOrder[i] == 'L':
		for j in range(10):
			if Rooms[j] == 0:
				Rooms[j] = 1
				break
	elif EventOrder[i] == 'R':
		for n in range(9, -1, -1):
			if Rooms[n] == 0:
				Rooms[n] = 1
				break
	else:
		Empty = ord(EventOrder[i]) - ord('0')
		Rooms[Empty] = 0
for i in range(10):
	print(Rooms[i], end='')


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


n = int(input())
s = input()
arr = [0] * 10
left = 0
right = 9
for a in range(n):
	if s[a] == 'L':
		if arr[left] == 1:
			while arr[left] != 0:
				left += 1
		arr[left] = 1
		left += 1
	elif s[a] == 'R':
		if arr[right] == 1:
			while arr[right] != 0:
				right -= 1
		arr[right] = 1
		right -= 1
	elif int(s[a]) >= 0 and int(s[a]) <= 9:
		arr[int(s[a])] = 0
		left = 0
		while arr[left] != 0:
			left += 1
		right = 9
		while arr[right] != 0:
			right -= 1
print(''.join(map(str, arr)))


a = int(input())
b = input()
c = '0000000000'
for i in range(a):
	if b[i] == 'L':
		c = c[:c.find('0')] + '1' + c[c.find('0') + 1:]
	elif b[i] == 'R':
		c = c[:c.rfind('0')] + '1' + c[c.rfind('0') + 1:]
	else:
		c = c[:int(b[i])] + '0' + c[int(b[i]) + 1:]
print(c)


n = int(input())
rooms = '0' * 10
rec = input()
for i in rec:
	if i == 'L':
		rooms = '{}1{}'.format(rooms[:rooms.find('0')], rooms[rooms.find('0') + 1:])
	elif i == 'R':
		rooms = '{}1{}'.format(rooms[:rooms.rfind('0')], rooms[rooms.rfind('0') + 1:])
	else:
		rooms = '{}0{}'.format(rooms[:int(i)], rooms[int(i) + 1:])
print(''.join([str(i) for i in rooms]))


s = ['0'] * 10
n = int(input())
a = list(input())
for i in a:
	if i == 'L':
		for i in range(10):
			if s[i] == '0':
				s[i] = '1'
				break
	elif i == 'R':
		for i in range(9, -1, -1):
			if s[i] == '0':
				s[i] = '1'
				break
	else:
		s[int(i)] = '0'
ans = ''
for i in s:
	ans += i
print(ans)


def findroom(inp):
	if inp == 'R':
		i = 9
		while ans[i] != 0:
			i -= 1
		ans[i] = 1
	else:
		i = 0
		while ans[i] != 0:
			i += 1
		ans[i] = 1
ans = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
n = int(input())
arr = str(input())
for i in range(n):
	if arr[i] != 'L' and arr[i] != 'R':
		ans[int(arr[i])] = 0
	else:
		findroom(arr[i])
Ans = ''
for i in range(10):
	Ans += str(ans[i])
print(Ans)


from sys import stdin, stdout
input = stdin.readline
n = int(input())
s = input()
ans = list('0000000000')
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:
		t = ord(s[i]) - 48
		ans[t] = '0'
print(''.join(ans))


x = int(input())
s = input()
a = [0 for i in range(10)]
for i in s:
	l = 0
	r = 9
	if i == 'L':
		while a[l] == 1:
			l += 1
		a[l] = 1
	elif i == 'R':
		while a[r] == 1:
			r -= 1
		a[r] = 1
	else:
		a[int(i)] = 0
for i in a:
	print(i, end='')


n = int(input())
l = list(input())
final = ['0'] * 10
for i in l:
	if i == 'L':
		curr = final.index('0')
		for j in range(curr, 0, -1):
			final[j] = final[j - 1]
		final[0] = '1'
	elif i == 'R':
		final = final[::-1]
		curr = final.index('0')
		for j in range(curr, -1, -1):
			final[j] = final[j - 1]
		final[0] = '1'
		final = final[::-1]
	else:
		num = int(i)
		final[num] = '0'
x = ''.join(final)
print(x)


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)))


x = int(input())
s = input()
l = [0] * 10
le = 0
r = len(l) - 1
for i in s:
	if i == 'L':
		for j in range(len(l)):
			if l[j] == 0:
				l[j] = 1
				break
	elif i == 'R':
		for j in range(len(l) - 1, -1, -1):
			if l[j] == 0:
				l[j] = 1
				break
	elif i in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
		l[int(i)] = 0
print(''.join(map(str, l)))


n = int(input())
events = list(input())
output = list('0000000000')
for i in range(n):
	if events[i] == 'L':
		output[output.index('0')] = '1'
	elif events[i] == 'R':
		output[10 - 1 - output[::-1].index('0')] = '1'
	else:
		output[int(events[i])] = '0'
print(''.join(output))


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)))


def num():
	return int(input())
from bisect import insort
n = num()
a = input()
ro = list(range(10))
for c in a:
	if c == 'L':
		del ro[0]
	elif c == 'R':
		del ro[-1]
	else:
		insort(ro, int(c))
print(''.join(('0' if i in ro else '1' for i in range(10))))


n = int(input())
s = list(input())
ans = ['0'] * 10
for i in s:
	if i == 'L':
		ans[ans.index('0')] = '1'
	elif i == 'R':
		ans = ans[::-1]
		ans[ans.index('0')] = '1'
		ans = ans[::-1]
	else:
		ans[ord(i) - ord('0')] = '0'
print(''.join(ans))


def findEmptyLeft(res):
	for i in range(len(res)):
		if res[i] == '0':
			return i

def findEmptyRight(res):
	for i in range(len(res) - 1, -1, -1):
		if res[i] == '0':
			return i
n = int(input())
events = input()
res = []
for i in range(10):
	res.append('0')
for c in events:
	if c == 'L':
		i = findEmptyLeft(res)
		res[i] = '1'
	elif c == 'R':
		i = findEmptyRight(res)
		res[i] = '1'
	else:
		room = int(c)
		res[room] = '0'
s = ''
for c in res:
	s += c
print(s)


n = int(input())
b = []
res = 'a'
for i in range(10):
	b.append(0)
l = 0
r = 0
a = input()
for i in range(n):
	if a[i] == 'L':
		k = b.index(0)
		b[k] = 1
	elif a[i] == 'R':
		b.reverse()
		b[b.index(0)] = 1
		b.reverse()
	else:
		b[int(a[i])] = 0
for i in range(10):
	res += str(b[i])
print(res[1:11])


rooms = list('0000000000')
n = int(input())
action = input()
start = 0
end = 9
for i in range(0, n):
	if action[i] == 'L':
		while rooms[start] != '0':
			start += 1
		rooms[start] = '1'
		start = 0
	elif action[i] == 'R':
		while rooms[end] != '0':
			end -= 1
		rooms[end] = '1'
		end = 9
	else:
		rooms[int(action[i])] = '0'
answer = ''
for i in range(0, 10):
	answer += rooms[i]
print(answer)


n = int(input())
s = input()
arr = [0] * 10
for i in s:
	if i == 'L':
		arr[arr.index(0)] = 1
	elif i == 'R':
		arr[9 - arr[::-1].index(0)] = 1
	else:
		arr[int(i)] = 0
print(*arr, sep='')


from collections import defaultdict
import math
x = int(input())
a = input()
rooms = [0] * 10
for i in a:
	if i == 'L':
		for j in range(10):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	else:
		rooms[int(i)] = 0
for i in range(10):
	print(rooms[i], end='')


m = int(input())
n = 10
i = input()
l = [0] * 10
for _ in i:
	if _ == 'L':
		for i in range(10):
			if l[i] == 0:
				l[i] = 1
				break
	elif _ == 'R':
		for i in range(10):
			if l[9 - i] == 0:
				l[9 - i] = 1
				break
	else:
		l[int(_)] = 0
for _ in range(n):
	print(l[_], end='')


n = int(input())
quartos = ['0'] * 10
eventos = input()
for i in range(n):
	if eventos[i] == 'L':
		quartos[quartos.index('0')] = '1'
	elif eventos[i] == 'R':
		quartos[''.join(quartos).rindex('0')] = '1'
	else:
		quartos[int(eventos[i])] = '0'
print(''.join(quartos))


n = int(input())
m = list(input())
k = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
for i in range(n):
	if m[i] == 'L':
		x = k.index('0')
		k[x] = '1'
	elif m[i] == 'R':
		y = k[::-1].index('0')
		k[9 - y] = '1'
	else:
		k[int(m[i])] = '0'
print(''.join(k))


(z, zz) = (input, lambda : list(map(int, z().split())))
fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = 1
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
arr = fast()
room = ['0'] * 10
for i in arr:
	if i == 'L':
		for (i, j) in enumerate(room):
			if j == '0':
				room[i] = '1'
				break
	elif i == 'R':
		for (i, j) in enumerate(room[::-1]):
			if j == '0':
				room[-i - 1] = '1'
				break
	else:
		room[int(i)] = '0'
print(''.join(room))


n = int(input())
rooms = ['0'] * 10
info = input()
for i in range(n):
	if info[i] == 'L':
		empty = rooms.index('0')
		rooms[empty] = '1'
	elif info[i] == 'R':
		rooms.reverse()
		empty = rooms.index('0')
		rooms[empty] = '1'
		rooms.reverse()
	else:
		rooms[int(info[i])] = '0'
print(''.join(rooms))


n = int(input())
a = [0] * 10
left = 0
right = 9
s = input()
for i in range(n):
	if s[i] == 'L':
		a[left] = 1
	elif s[i] == 'R':
		a[right] = 1
	else:
		a[int(s[i])] = 0
	try:
		left = a.index(0)
	except:
		left = -1
	tmp = a[::-1]
	try:
		right = 9 - tmp.index(0)
	except:
		right = -1
for i in range(len(a)):
	print(a[i], end='')


num_rooms = int(input())
rooms = []
for i in range(10):
	rooms.append('0')
instructions = input()

def add_character(char, lst):
	placed = False
	if char == 'L':
		index = 0
		while placed == False:
			if lst[index] == '0':
				lst[index] = 'L'
				placed = True
			else:
				index += 1
	else:
		index = -1
		while placed == False:
			if lst[index] == '0':
				lst[index] = 'R'
				placed = True
			else:
				index -= 1

def remove(index, lst):
	lst[index] = '0'
for current in range(len(instructions)):
	if instructions[current] == 'L':
		add_character('L', rooms)
	elif instructions[current] == 'R':
		add_character('R', rooms)
	else:
		remove(int(instructions[current]), rooms)
answer = ''
for current_char in rooms:
	if current_char == '0':
		answer += '0'
	else:
		answer += '1'
print(answer)


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


x = int(input())
arrange = input()
arr = [0] * 10
for i in range(x):
	if arrange[i] == 'L':
		for k in range(10):
			if arr[k] == 0:
				arr[k] = 1
				break
	elif arrange[i] == 'R':
		for m in range(10):
			if arr[10 - m - 1] == 0:
				arr[10 - m - 1] = 1
				break
	else:
		arr[int(arrange[i])] = 0
str1 = ''.join((str(e) for e in arr))
print(str1)


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


events = input()
des = input()
hotel = []
test = int(events)
for i in range(0, 10):
	hotel.append(0)
for i in range(0, test):
	if des[i] == 'L':
		for i in range(0, 10):
			if hotel[i] == 0:
				hotel[i] = 1
				break
	elif des[i] == 'R':
		for i in range(0, 10):
			x = 9 - i
			if hotel[x] == 0:
				hotel[x] = 1
				break
	else:
		index = int(des[i])
		hotel[index] = 0
newhotel = ''
for i in range(0, 10):
	newhotel += str(hotel[i])
print(newhotel)


l = [0] * 10
st = 0
dr = 9
n = input()
s = input()
for x in s:
	if x == 'L':
		st = l.index(0)
		l[st] = 1
	elif x == 'R':
		dr = 9 - l[::-1].index(0)
		l[dr] = 1
	else:
		l[int(x)] = 0
print(*l, sep='')


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


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


n = int(input())
s = input()
status = [0 for i in range(10)]
for c in s:
	if c == 'L':
		ind = status.index(0)
		status[ind] = 1
	elif c == 'R':
		ind = 9 - status[::-1].index(0)
		status[ind] = 1
	else:
		ind = int(c)
		status[ind] = 0
out = ''.join(map(str, status))
print(out)


def solve(rooms, l):
	a = list(rooms)
	if l == 'L':
		for i in range(10):
			if a[i] == '0':
				a[i] = '1'
				break
	elif l == 'R':
		for i in range(9, -1, -1):
			if a[i] == '0':
				a[i] = '1'
				break
	else:
		n = int(l)
		a[n] = '0'
	return ''.join(a)
n = int(input())
s = input()
rooms = '0' * 10
for i in range(n):
	rooms = solve(rooms, s[i])
print(rooms)


n = int(input())
d = ''
ev = str(input())
kq = []
kqi = 0
while kqi <= 9:
	kq.append(0)
	kqi = kqi + 1
for m in ev:
	if m == 'L':
		i = 0
		while kq[i] != 0:
			i = i + 1
		kq[i] = 1
	elif m == 'R':
		j = 9
		while kq[j] != 0:
			j = j - 1
		kq[j] = 1
	else:
		kq[int(m)] = 0
print(d.join([str(a) for a in kq]))


n = input()
cad = input()
rooms = '0' * 10
for c in cad:
	if c == 'L':
		index = rooms.find('0')
		tmp = list(rooms)
		tmp[index] = '1'
		rooms = ''.join(tmp)
	elif c == 'R':
		index = rooms.rfind('0')
		tmp = list(rooms)
		tmp[index] = '1'
		rooms = ''.join(tmp)
	else:
		tmp = list(rooms)
		tmp[int(c)] = '0'
		rooms = ''.join(tmp)
print(''.join(rooms))


n = int(input())
l = list(input().strip())
room = [0 for a in range(0, 10)]
for i in l:
	if i == 'L':
		for j in range(0, 10):
			if room[j] == 0:
				room[j] = 1
				break
	elif i == 'R':
		for j in range(-1, -11, -1):
			if room[j] == 0:
				room[j] = 1
				break
	else:
		room[int(i)] = 0
print(''.join((str(x) for x in room)))


n = int(input())
a = input()
b = [0 for x in range(10)]
for x in a:
	if x == 'L':
		for i in range(len(b)):
			if b[i] == 0:
				b[i] = 1
				break
	elif x == 'R':
		for i in range(len(b) - 1, -1, -1):
			if b[i] == 0:
				b[i] = 1
				break
	else:
		b[int(x)] = 0
for i in b:
	print(i, end='')


n = int(input())
rooms = input()
hotel = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for x in rooms:
	if x == 'L':
		for i in range(0, 10):
			if hotel[i] == 0:
				hotel[i] = 1
				break
	elif x == 'R':
		for j in range(9, -1, -1):
			if hotel[j] == 0:
				hotel[j] = 1
				break
	else:
		r = int(x)
		hotel[r] = 0
for x in hotel:
	print(x, end='')


def main():
	x = [0] * 10
	n = int(input())
	l = [i for i in input()]
	for z in l:
		if z == 'L':
			for i in range(10):
				if x[i] == 0:
					x[i] = 1
					break
		elif z == 'R':
			for i in [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]:
				if x[i] == 0:
					x[i] = 1
					break
		else:
			x[int(z)] = 0
	print(*x, sep='')
main()


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


n = input()
data = input()
out = [0] * 10
for i in range(len(data)):
	if data[i] == 'L':
		for j in range(0, 10, 1):
			if out[j] == 0:
				out[j] = 1
				break
	elif data[i] == 'R':
		for k in range(9, -1, -1):
			if out[k] == 0:
				out[k] = 1
				break
	else:
		out[int(data[i])] = 0
for x in out:
	print(x, end='')


n = int(input())
ass = list(input())
rooms = [0] * 10
for i in range(n):
	if ass[i] == 'L':
		for i in range(len(rooms)):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	elif ass[i] == 'R':
		for i in range(len(rooms) - 1, -1, -1):
			if rooms[i] == 0:
				rooms[i] = 1
				break
	else:
		rooms[int(ass[i])] = 0
print(*rooms, sep='')


n = int(input())
comands = input()
list(comands)
ll = ['0' for i in range(10)]
for i in range(n):
	if comands[i] == 'L':
		idx = ll.index('0')
		ll[idx] = '1'
	elif comands[i] == 'R':
		ll.reverse()
		idx = ll.index('0')
		ll[idx] = '1'
		ll.reverse()
	else:
		idx = int(comands[i])
		ll[idx] = '0'
print(''.join(ll))


ROOM = [0] * 10

def event(c):
	if c == 'R':
		for i in range(9, -1, -1):
			if ROOM[i] == 0:
				ROOM[i] = 1
				break
	if c == 'L':
		for i in range(0, 10):
			if ROOM[i] == 0:
				ROOM[i] = 1
				break
	if c != 'R' and c != 'L':
		num = int(c)
		ROOM[num] = 0
le = input()
st = input()
for c in st:
	event(c)
print(''.join(map(str, ROOM)))


l = int(input())
n = input()
nn = list()
for i in range(l):
	nn.append(n[i])
k = list()
p = -1
for i in range(10):
	k.append(0)
for i in range(l):
	if nn[i] != 'L' and nn[i] != 'R':
		p = int(nn[i])
		k[p] = 0
	if nn[i] == 'L':
		for j in range(10):
			if k[j] == 0:
				k[j] = 1
				break
	if nn[i] == 'R':
		for j in range(9, -1, -1):
			if k[j] == 0:
				k[j] = 1
				break
for i in k:
	print(i, end='')


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


n = int(input())
s = input()
lis = [0] * 10
l = 0
r = n - 1
for i in range(n):
	if s[i] == 'L':
		for j in range(10):
			if lis[j] == 0:
				lis[j] = 1
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if lis[j] == 0:
				lis[j] = 1
				break
	else:
		lis[int(s[i])] = 0
print(*lis, sep='')


n = int(input())
l = list(input())
z = [0 for i in range(10)]
for i in l:
	if i == 'L':
		for j in range(10):
			if z[j] == 0:
				z[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if z[j] == 0:
				z[j] = 1
				break
	else:
		z[int(i)] = 0
s = ''
for i in z:
	s = s + str(i)
print(s)


n = int(input())
s = input().split()[0]
rooms = [0 for _ in range(10)]
for c in s:
	if c == 'L':
		i = 0
		while rooms[i] != 0:
			i += 1
		rooms[i] = 1
	elif c == 'R':
		i = 9
		while rooms[i] != 0:
			i -= 1
		rooms[i] = 1
	elif ord(c) >= ord('0') and ord(c) <= ord('9'):
		rooms[int(c)] = 0
print(*rooms, sep='')


input()
R = [0] * 10
for l in input():
	if l == 'L':
		R[R.index(0)] = 1
	elif l == 'R':
		R[-R[::-1].index(0) - 1] = 1
	else:
		R[int(l)] = 0
print(''.join(map(str, R)))


n = int(input())
s = str(input())
s = list(s)
rooms = [0] * 10
for i in s:
	if i == 'L':
		for tmp in range(10):
			if rooms[tmp] == 0:
				rooms[tmp] = 1
				break
	elif i == 'R':
		for tmp in range(9, -1, -1):
			if rooms[tmp] == 0:
				rooms[tmp] = 1
				break
	else:
		rooms[int(i)] = 0
for i in rooms:
	print(i, end='')


n = int(input(''))
a = input('')
s = [0] * 10
ml = 0
mr = 9
for i in range(n):
	if a[i] == 'L':
		s[ml] = 1
	elif a[i] == 'R':
		s[mr] = 1
	else:
		x = int(a[i])
		s[x] = 0
	mn = 10
	mx = -1
	for t in range(10):
		if s[t] == 0:
			if t > mx:
				mx = t
			if t < mn:
				mn = t
	ml = mn
	mr = mx
for i in range(10):
	print(s[i], end='')


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

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

def li():
	return list(map(int, input().split()))
n = ii()
s = input()
r = ['0'] * 10
for i in s:
	if i == 'L':
		t = 0
		while t < 10:
			if r[t] == '0':
				r[t] = '1'
				break
			t += 1
	elif i == 'R':
		t = 9
		while t >= 0:
			if r[t] == '0':
				r[t] = '1'
				break
			t -= 1
	else:
		r[int(i)] = '0'
print(''.join(r))


n = int(input())
s = input()
b = list('0' * 10)
for i in s:
	if i == 'L':
		j = b.index('0')
		b[j] = '1'
	elif i == 'R':
		a = b[::-1]
		j = a.index('0')
		b[10 - j - 1] = '1'
	else:
		b[int(i)] = '0'
print(''.join(b))


def join(a):
	final = ''
	for i in a:
		final = final + str(i)
	return final
n = int(input())
a = list(input())
ans = [0] * 10
j = 0
k = 9
for i in a:
	if i == 'L':
		while ans[j] != 0:
			j = j + 1
		ans[j] = 1
		j = 0
	elif i == 'R':
		while ans[k] != 0:
			k = k - 1
		ans[k] = 1
		k = 9
	else:
		ans[int(i)] = 0
print(join(ans))


ans = ['0'] * 10
input()
for c in input().lower():
	if c == 'l':
		ans[ans.index('0')] = '1'
	elif c == 'r':
		ans[9 - ans[::-1].index('0')] = '1'
	else:
		ans[int(c)] = '0'
print(''.join(ans))


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


def main(length, memory):
	initial = [0 for x in range(10)]
	for x in memory:
		if x == 'L':
			c = 0
			for x in initial:
				if x == 0:
					initial[c] = 1
					break
				c += 1
		elif x == 'R':
			c = 0
			for x in initial[::-1]:
				if x == 0:
					initial[9 - c] = 1
					break
				c += 1
		else:
			initial[int(x)] = 0
	return ''.join([str(x) for x in initial])
a = int(input())
b = input()
print(main(a, b))


import sys
rooms = ['0'] * 10
n = int(sys.stdin.readline())
strr = sys.stdin.readline().strip()
min_left = 0
max_right = 9
for event in strr:
	if event == 'L':
		i = min_left
		while i < n and rooms[i] != '0':
			i += 1
		rooms[i] = '1'
		min_left = i
	elif event == 'R':
		i = max_right
		while i >= 0 and rooms[i] != '0':
			i -= 1
		rooms[i] = '1'
		max_right = i
	else:
		pos = int(event)
		rooms[pos] = '0'
		if pos < min_left:
			min_left = pos
		if pos > max_right:
			max_right = pos
print(''.join(rooms))


room = [0] * 10

def putInLeft():
	for i in range(0, 10):
		if room[i] == 0:
			room[i] = 1
			break

def putInRight():
	i = 9
	while i >= 0:
		if room[i] == 0:
			room[i] = 1
			break
		i -= 1
n = int(input())
s = input()
for x in s:
	if x == 'L':
		putInLeft()
	elif x == 'R':
		putInRight()
	else:
		room[int(x)] = 0
for m in room:
	print(m, end='')


a = int(input())
s = input()
arr = [0] * 10
for i in s:
	if i == 'L':
		j = 0
		while arr[j] != 0:
			j += 1
		arr[j] = 1
	elif i == 'R':
		j = 9
		while arr[j] != 0:
			j -= 1
		arr[j] = 1
	else:
		arr[int(i)] = 0
for i in arr:
	print(i, end='')


n = int(input())
x = list(input())
a = [0] * 10
for i in range(n):
	if x[i] == 'L':
		j = 0
		while 1:
			if a[j] == 0:
				break
			else:
				j = j + 1
		a[j] = 1
	elif x[i] == 'R':
		j = 9
		while 1:
			if a[j] == 0:
				break
			else:
				j = j - 1
		a[j] = 1
	else:
		a[int(x[i])] = 0
for i in a:
	print(i, end='')


def leftPush(rooms):
	i = 0
	while True:
		if rooms[i] == False:
			rooms[i] = True
			break
		i += 1
	return rooms

def rightPush(rooms):
	i = 9
	while True:
		if rooms[i] == False:
			rooms[i] = True
			break
		i -= 1
	return rooms

def pop(rooms, i):
	rooms[i] = False
	return rooms
N = int(input())
inputs = input()
rooms = [False for i in range(10)]
for c in inputs:
	if c == 'L':
		rooms = leftPush(rooms)
	elif c == 'R':
		rooms = rightPush(rooms)
	else:
		rooms = pop(rooms, int(c))
for room in rooms:
	print(1 if room else 0, end='')


input()
events = input().strip()
nor = 10
alist = [0] * 10
for e in events:
	if e == 'L':
		for i in range(nor):
			if alist[i] == 0:
				alist[i] = 1
				break
	elif e == 'R':
		for i in range(nor):
			if alist[nor - i - 1] == 0:
				alist[nor - i - 1] = 1
				break
	else:
		alist[int(e)] = 0
ans = ''
for x in alist:
	ans += str(x)
print(ans)


n = int(input())
s = ['0'] * 10
line = input()
for i in range(n):
	if line[i] == 'L':
		s[s.index('0')] = '1'
	elif line[i] == 'R':
		z = s[::-1]
		s[9 - z.index('0')] = '1'
	else:
		s[int(line[i])] = '0'
print(''.join(s))


n = int(input())
l = [0 for i in range(10)]
l1 = list(input())
k = ''
for i in range(n):
	if l1[i] == 'L':
		l[l.index(0)] = 1
	elif l1[i] == 'R':
		l = l[::-1]
		l[l.index(0)] = 1
		l = l[::-1]
	else:
		l[int(l1[i])] = 0
for i in l:
	k += str(i)
print(k)


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


n = int(input())
p = input().rstrip()
x = list(p)
l = [0] * 10
for i in range(0, len(x)):
	if x[i] == 'L':
		T = l.index(0)
		l[T] = 1
	elif x[i] == 'R':
		C = list(l)
		C.reverse()
		B = 10 - 1 - C.index(0)
		l[B] = 1
	else:
		l[int(x[i])] = 0
for i in range(0, len(l)):
	print(l[i], end='')


n = int(input())
s = input()
rooms = [False] * 10

def set_left(rooms):
	ind = 0
	while rooms[ind]:
		ind += 1
	rooms[ind] = True

def set_right(rooms):
	ind = len(rooms) - 1
	while rooms[ind]:
		ind -= 1
	rooms[ind] = True
for c in s:
	if c == 'L':
		set_left(rooms)
	elif c == 'R':
		set_right(rooms)
	else:
		rooms[ord(c) - ord('0')] = False
print(''.join(map(str, map(int, rooms))))


n = int(input())
s = input()
a = [0] * 10
l = 0
r = 9
for i in s:
	if i == 'L':
		while a[l] != 0:
			l += 1
		a[l] = 1
	elif i == 'R':
		while a[r] != 0:
			r -= 1
		a[r] = 1
	else:
		a[int(i)] = 0
		l = 0
		r = 9
for item in a:
	print(item, end='')


t = int(input())
hotel = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
s = input()
for j in s:
	if j == 'L':
		if '0' in hotel:
			h = hotel.index('0')
			hotel[h] = '1'
	elif j == 'R':
		for i in range(9, -1, -1):
			if hotel[i] != '1':
				hotel[i] = '1'
				break
	else:
		hotel[int(j)] = '0'
print(''.join(hotel))


from sys import stdin
a = int(stdin.readline())
b = list(stdin.readline().rstrip())
c = list(('0' for i in range(0, 10)))
for i in b:
	if i == 'L':
		for j in range(0, 10):
			if c[j] == '0':
				c[j] = '1'
				break
	elif i == 'R':
		for j in range(0, 10):
			if c[9 - j] == '0':
				c[9 - j] = '1'
				break
	else:
		c[int(i)] = '0'
print(''.join(c))


L = 'L'
R = 'R'
IN = '1'
OUT = '0'
N = int(input())
A = input()
C = 10
AL = [OUT] * C
for i in range(N):
	if A[i] == L:
		for c in range(C):
			if AL[c] == OUT:
				AL[c] = IN
				break
	elif A[i] == R:
		for c in reversed(range(C)):
			if AL[c] == OUT:
				AL[c] = IN
				break
	else:
		r = int(A[i])
		AL[r] = OUT
print(''.join(AL))


n = int(input())
s = input()
x = []
for i in range(10):
	x.append('0')
for i in range(n):
	if s[i] == 'L':
		for j in range(10):
			if x[j] == '0':
				x[j] = '1'
				break
	elif s[i] == 'R':
		j = 9
		while j >= 0:
			if x[j] == '0':
				x[j] = '1'
				break
			j = j - 1
	else:
		a = int(s[i])
		for j in range(10):
			x[a] = '0'
print(''.join(x))


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


n = int(input())
A = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

def Ans(A, i):
	if i == 1:
		count = 0
		for val in A:
			if val == 0:
				return count
			count += 1
	else:
		count = 9
		for val in A[::-1]:
			if val == 0:
				return count
			count -= 1
for i in input():
	if i == 'L':
		A[Ans(A, 1)] = 1
	elif i == 'R':
		A[Ans(A, 2)] = 1
	else:
		A[int(i)] = 0
A = list(map(str, A))
print(''.join(A))


n = input()
string = input()
result = ['0'] * 10
res = ''
for x in string:
	if x is 'L':
		for i in range(0, 10):
			if result[i] == '0':
				result[i] = '1'
				break
	elif x is 'R':
		for j in range(0, 10):
			if result[9 - j] == '0':
				result[9 - j] = '1'
				break
	else:
		result[int(x)] = '0'
print(res.join(result))


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def main():
	n = inin()
	l = sin()
	a = [0] * 10
	x = 0
	y = n - 1
	for i in range(n):
		if l[i] == 'L':
			for i in range(10):
				if a[i] == 0:
					a[i] = 1
					break
		elif l[i] == 'R':
			for i in range(9, -1, -1):
				if a[i] == 0:
					a[i] = 1
					break
		else:
			a[int(l[i])] = 0
	print(*a, sep='')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


n = int(input())
s = input()
arr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
	try:
		arr[int(s[i])] = 0
	except:
		if s[i] == 'L':
			for j in range(len(arr)):
				if arr[j] == 0:
					arr[j] = 1
					break
		elif s[i] == 'R':
			for j in reversed(range(len(arr))):
				if arr[j] == 0:
					arr[j] = 1
					break
for _ in range(len(arr)):
	print(arr[_], end='')


n = int(input())
acts = input()
rooms = [0 for _ in range(10)]
for act in acts:
	if act == 'L':
		for n in range(len(rooms)):
			if rooms[n] == 0:
				rooms[n] = 1
				break
	elif act == 'R':
		for n in range(len(rooms) - 1, -1, -1):
			if rooms[n] == 0:
				rooms[n] = 1
				break
	else:
		rooms[int(act)] = 0
for r in rooms:
	print(r, end='')


n = int(input())
s = input()
rooms = [0] * 10
k = 0
j = 9
for i in range(n):
	if s[i] == 'L':
		while rooms[k] == 1:
			k += 1
		rooms[k] = 1
	elif s[i] == 'R':
		while rooms[j] == 1:
			j -= 1
		rooms[j] = 1
	else:
		x = int(s[i])
		rooms[x] = 0
		k = min(x, k)
		j = max(j, x)
ans = ''
for i in range(10):
	ans += str(rooms[i])
print(ans)


n = int(input())
x = input()
ansar = [0] * 10
for i in range(n):
	if x[i] == 'L':
		for j in range(10):
			if ansar[j] == 0:
				ansar[j] = 1
				break
	elif x[i] == 'R':
		for k in range(9, -1, -1):
			if ansar[k] == 0:
				ansar[k] = 1
				break
	else:
		ansar[int(x[i])] = 0
print(*ansar, sep='')


current = [0 for _ in range(10)]
num_events = input()
events = input()
for i in range(int(num_events)):
	if events[i] == 'L':
		for j in range(len(current)):
			if current[j] == 0:
				current[j] = 1
				break
	elif events[i] == 'R':
		for j in reversed(range(len(current))):
			if current[j] == 0:
				current[j] = 1
				break
	else:
		current[int(events[i])] = 0

def convert(list):
	res = ''.join(map(str, list))
	return res
print(convert(current))


class Hotel:

	def __init__(self):
		self.rooms = [False] * 10

	def __str__(self):
		return ''.join(map(lambda x: str(int(x)), self.rooms))

	def add_left(self, **kwargs):
		for (key, room) in enumerate(self.rooms):
			if not room:
				self.rooms[key] = True
				break

	def add_right(self, **kwargs):
		for (key, room) in reversed(list(enumerate(self.rooms))):
			if not room:
				self.rooms[key] = True
				break

	def remove(self, room_id, **kwargs):
		self.rooms[int(room_id)] = False
hotel = Hotel()
vocab = {'L': hotel.add_left, 'R': hotel.add_right}
input()
for s in input():
	vocab.get(s, hotel.remove)(room_id=s)
print(hotel)


from sys import stdin
input = stdin.readline
ans = [0] * 10
n = int(input())
s = input().strip()
for i in s:
	if i == 'L':
		j = 0
		while ans[j] == 1:
			j += 1
		ans[j] = 1
	elif i == 'R':
		j = 9
		while ans[j] == 1:
			j -= 1
		ans[j] = 1
	else:
		ans[int(i)] = 0
for i in ans:
	print(i, end='')
print()


n = int(input())
s = input()
arr = [0] * 10
l1 = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
for i in s:
	if i == 'L':
		for j in range(len(arr)):
			if arr[j] == 0:
				arr[j] = 1
				break
	elif i == 'R':
		for j in range(len(arr) - 1, -1, -1):
			if arr[j] == 0:
				arr[j] = 1
				break
	elif i in l1:
		arr[int(i)] = 0
for k in arr:
	print(k, end='')


n = int(input())
l = list(input())
l1 = [0] * 10
for i in l:
	for x in range(len(l1)):
		if i == 'L':
			if l1[x] == 0:
				l1[x] = 1
				break
		elif i == 'R':
			if l1[9 - x] == 0:
				l1[9 - x] = 1
				break
		else:
			l1[int(i)] = 0
			break
print(*l1, sep='')


n = int(input())
events = input()
rooms = [0] * 10
output = ''
for i in events:
	if i == 'L':
		for j in range(len(rooms)):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	elif i == 'R':
		for j in range(len(rooms) - 1, -1, -1):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	else:
		rooms[int(i)] = 0
for i in rooms:
	output += str(i)
print(output)


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


n = int(input())
l = list(input())
o = '0000000000'
z = list(o)
for i in range(n):
	if l[i] == 'L':
		for j in range(10):
			if z[j] == '1':
				continue
			else:
				z[j] = '1'
				break
	elif l[i] == 'R':
		for j in range(10):
			if z[10 - 1 - j] == '1':
				continue
			else:
				z[10 - 1 - j] = '1'
				break
	else:
		z[int(l[i])] = '0'
print(''.join(z))


li = [0] * 10
n = int(input())
s = input()
for i in s:
	if i == 'L':
		li[li.index(0)] = 1
	elif i == 'R':
		idx = li[::-1].index(0) + 1
		li[-idx] = 1
	else:
		li[int(i)] = 0
for i in li:
	print(i, end='')


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

def umiestni_zlava(r):
	for i in range(10):
		if r[i] == 0:
			r[i] = 1
			break

def umiestni_sprava(r):
	for i in range(10):
		if r[9 - i] == 0:
			r[9 - i] = 1
			break
for s in S:
	if s == 'L':
		umiestni_zlava(r)
	elif s == 'R':
		umiestni_sprava(r)
	else:
		ind = eval(s)
		r[ind] = 0
print(''.join((str(i) for i in r)))


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]))


n = int(input())
ls = [0] * 10
l = 0
r = 9
s = input()
for i in s:
	if i == 'L':
		if ls[l] == 0:
			ls[l] = 1
			l += 1
		else:
			while ls[l] == 1:
				l += 1
			ls[l] = 1
			l += 1
	elif i == 'R':
		if ls[r] == 0:
			ls[r] = 1
			r -= 1
		else:
			while ls[r] == 1:
				r -= 1
			ls[r] = 1
			r -= 1
	else:
		cr = int(i)
		ls[cr] = 0
		if cr < l:
			l = cr
		elif cr > r:
			r = cr
ans = ''
for i in ls:
	ans += str(i)
print(ans)


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


n = int(input())
a = input()
b = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in a:
	if i == 'R':
		b[-list(reversed(b)).index(0) - 1] = 1
	elif i == 'L':
		b[b.index(0)] = 1
	else:
		b[int(i)] = 0
print(*b, sep='')


n = int(input())
a = input()
s = [False] * 10

def push_left():
	for j in range(n):
		if not s[j]:
			s[j] = True
			break

def push_right():
	for j in range(9, -1, -1):
		if not s[j]:
			s[j] = True
			break
for i in range(n):
	if a[i] == 'L':
		push_left()
	elif a[i] == 'R':
		push_right()
	else:
		s[int(a[i])] = False
print(''.join(['1' if i else '0' for i in s]))


n = int(input())
a = input()
ans = ['0' for _ in range(10)]
for v in a:
	if v == 'L':
		for i in range(10):
			if ans[i] == '0':
				ans[i] = '1'
				break
	elif v == 'R':
		for i in range(9, -1, -1):
			if ans[i] == '0':
				ans[i] = '1'
				break
	else:
		ans[int(v)] = '0'
print(''.join(ans))


kol = int(input())
sp = list(input())
a = ['0'] * 10
for i in sp:
	if i == 'L':
		a[a.index('0')] = '1'
	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(a))


def parser():
	while 1:
		data = list(input().split(' '))
		for number in data:
			if len(number) > 0:
				yield number
input_parser = parser()

def get_word():
	global input_parser
	return next(input_parser)

def get_number():
	data = get_word()
	try:
		return int(data)
	except ValueError:
		return float(data)
nums = []
n = get_number()
r = [0 for i in range(10)]
w = get_word()
for l in w:
	if l == 'L':
		for i in range(len(r)):
			if r[i] == 0:
				r[i] = 1
				break
	elif l == 'R':
		for i in range(len(r) - 1, -1, -1):
			if r[i] == 0:
				r[i] = 1
				break
	else:
		num = int(l)
		r[num] = 0
res = ''
for i in r:
	res += str(i)
print(res)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(1):
	n = int(input())
	s = input()
	a = [0] * 10
	for x in s:
		if x == 'L':
			for t in range(10):
				if not a[t]:
					a[t] = 1
					break
		elif x == 'R':
			for t in range(9, -1, -1):
				if not a[t]:
					a[t] = 1
					break
		else:
			a[int(x)] = 0
	for x in a:
		print(x, end='')


from collections import defaultdict as ddict
from sys import stdin

def main():
	n = int(stdin.readline())
	rooms = ddict(int)
	for c in (stdin.read(1) for _ in range(n)):
		if c == 'L':
			for i in range(10):
				if not rooms[i]:
					rooms[i] = 1
					break
		elif c == 'R':
			for i in range(9, -1, -1):
				if not rooms[i]:
					rooms[i] = 1
					break
		else:
			rooms[int(c)] = 0
	for i in range(10):
		print(rooms[i], end='')
	print()
main()


n = int(input())
s = input()
li = '0000000000'
for i in range(len(s)):
	if s[i] == 'L':
		li = li.replace('0', '1', 1)
	elif s[i] == 'R':
		li = li[::-1]
		li = li.replace('0', '1', 1)
		li = li[::-1]
	if s[i].isnumeric():
		li = li[:int(s[i])] + '0' + li[int(s[i]) + 1:]
print(li)


n = int(input())
line = input()
arr = ['0' for i in range(10)]
for c in line:
	if c == 'L':
		for i in range(10):
			if arr[i] == '0':
				arr[i] = '1'
				break
	elif c == 'R':
		for i in reversed(range(10)):
			if arr[i] == '0':
				arr[i] = '1'
				break
	else:
		t = int(c)
		arr[t] = '0'
print(''.join(arr))


import sys
fin = sys.stdin
nofevents = int(fin.readline().rstrip())
events = [i for i in fin.readline().rstrip()]
rooms = [0] * 10
numset = set()

def left():
	for i in range(10):
		if rooms[i] == 0:
			rooms[i] = 1
			return True

def right():
	for i in range(9, -1, -1):
		if rooms[i] == 0:
			rooms[i] = 1
			return True
for i in events:
	if i == 'R':
		right()
	elif i == 'L':
		left()
	else:
		rooms[int(i)] = 0
ans = ''
for i in rooms:
	ans += str(i)
print(ans)


n = int(input())
t = input()
l1 = ['0'] * 10
for i in range(n):
	if t[i] == 'L':
		k = l1.index('0')
		l1[k] = '1'
	elif t[i] == 'R':
		k = l1[::-1].index('0')
		l1[9 - k] = '1'
	else:
		l1[int(t[i])] = '0'
print(*l1, sep='')


def Hotelier(n, sequence):
	result = ['0' for i in range(10)]
	minL = 0
	minR = 9
	for s in sequence:
		if s == 'L':
			i = 0
			while i < 10:
				if result[i] == '0':
					result[i] = '1'
					break
				i += 1
		elif s == 'R':
			i = 9
			while i >= 0:
				if result[i] == '0':
					result[i] = '1'
					break
				i -= 1
		else:
			index = int(s)
			result[index] = '0'
	strResult = ''
	for r in result:
		strResult += r
	return strResult
n = int(input())
sequence = input()
print(Hotelier(n, sequence))


from sys import stdin, stdout
input = stdin.readline
n = int(input())
s = input()
a = [0] * 10
for i in range(0, n):
	if s[i] == 'L':
		j = 0
		while a[j] != 0:
			j += 1
		a[j] = 1
	elif s[i] == 'R':
		j = 9
		while a[j] != 0:
			j -= 1
		a[j] = 1
	else:
		a[int(s[i])] = 0
print(''.join(map(str, a)))


import sys, math
input = sys.stdin.readline
n = int(input())
a = list(input())
a.pop()
q = ['0'] * 10
for i in range(len(a)):
	if a[i] == 'L':
		for j in range(10):
			if q[j] == '0':
				q[j] = '1'
				break
	elif a[i] == 'R':
		j = 9
		while j >= 0:
			if q[j] == '0':
				q[j] = '1'
				break
			j = j - 1
	else:
		q[int(a[i])] = '0'
print(''.join(q))


from sys import stdin
hat = stdin.readlines()
lst = ['0'] * 10
for i in range(len(hat[1])):
	x = hat[1][i]
	try:
		x = int(x)
		lst[x] = '0'
	except:
		if x == 'L':
			for j in range(len(lst)):
				if lst[j] == '0':
					lst[j] = '1'
					break
		elif x == 'R':
			for j in range(len(lst) - 1, -1, -1):
				if lst[j] == '0':
					lst[j] = '1'
					break
print(''.join(lst))


def main():
	n = int(input())
	arr = [0 for _ in range(10)]
	s = input()
	for c in s:
		if c == 'L':
			i = 0
			while i < n and arr[i] == 1:
				i += 1
			arr[i] = 1
		elif c == 'R':
			i = 9
			while i >= 0 and arr[i] == 1:
				i -= 1
			arr[i] = 1
		else:
			arr[int(c)] = 0
	for i in arr:
		print(i, end='')
	print('')
main()


n = input()
s = input()
a = [0] * 10
for x in s:
	if x == 'L':
		for i in range(10):
			if not a[i]:
				a[i] = 1
				break
	elif x == 'R':
		for i in range(9, -1, -1):
			if not a[i]:
				a[i] = 1
				break
	else:
		a[int(x)] = 0
print(*a, sep='')


n = int(input())
e = list(input())
v = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
arr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in e:
	if i == 'L':
		arr[v[0]] = 1
		v = v[1:]
	elif i == 'R':
		arr[v[len(v) - 1]] = 1
		v = v[0:len(v) - 1]
	else:
		arr[int(i)] = 0
		v.append(int(i))
		v.sort()
s = ''
for i in range(10):
	s = s + str(arr[i])
print(s)


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

def get_r_index():
	ind = -1
	while a[ind] != 0:
		ind -= 1
	return ind

def get_l_index():
	ind = 0
	while a[ind] != 0:
		ind += 1
	return ind
for i in range(n):
	if s[i] == 'R':
		a[get_r_index()] = 1
	elif s[i] == 'L':
		a[get_l_index()] = 1
	else:
		pos = int(s[i])
		a[pos] = 0
for i in a:
	print(i, end='')


n = int(input())
s = input()
sr = s[::-1]
a = [0] * 10
for i in s:
	if i == 'L':
		a[a.index(0)] = 1
	elif i == 'R':
		a[9 - a[::-1].index(0)] = 1
	else:
		a[int(i)] = 0
p = ''
for i in a:
	p = p + str(i)
print(p)


def main():
	n = int(input())
	s = input()
	tab = [0] * 10
	for char in s:
		if char == 'L':
			for x in range(10):
				if tab[x] == 0:
					tab[x] = 1
					break
		elif char == 'R':
			for x in range(9, -1, -1):
				if tab[x] == 0:
					tab[x] = 1
					break
		else:
			tab[int(char)] = 0
	s = ''
	for x in range(10):
		s += str(tab[x])
	print(s)
main()


rooms = [0] * 10
num = int(input())
data = input()
for i in range(num):
	l = data[i]
	if l == 'L':
		for j in range(10):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	elif l == 'R':
		for j in range(9, -1, -1):
			if rooms[j] == 0:
				rooms[j] = 1
				break
	else:
		rooms[int(l)] = 0
for r in rooms:
	print(r, end='')
print()


sosatb = []
ans = ''
count = int(input())
inputs = input()
inputs = list(inputs)
for i in range(0, 10):
	sosatb.append(0)
for choose in inputs:
	if choose == 'L':
		dex = sosatb.index(0)
		sosatb[dex] = 1
	elif choose == 'R':
		sosatb.reverse()
		dex = sosatb.index(0)
		sosatb[dex] = 1
		sosatb.reverse()
	else:
		a = int(choose)
		sosatb[a] = 0
for i in sosatb:
	ans = ans + str(i)
print(ans)


n = int(input())
a = input()
r = [0] * 10
lind = 0
rind = 9
for i in a:
	if i == 'L':
		for j in range(len(r)):
			if r[j] == 0:
				r[j] = 1
				break
	elif i == 'R':
		for j in range(len(r) - 1, -1, -1):
			if r[j] == 0:
				r[j] = 1
				break
	else:
		r[int(i)] = 0
print(*r, sep='')


n = int(input())
s = str(input())
rooms = ['0'] * 10
memory = list(str(s))
for i in range(0, n):
	if memory[i] == 'L':
		for j in range(0, 10):
			if rooms[j] == '0':
				rooms[j] = '1'
				break
			else:
				pass
	elif memory[i] == 'R':
		for j in range(-1, -11, -1):
			if rooms[j] == '0':
				rooms[j] = '1'
				break
			else:
				pass
	else:
		k = memory[i]
		rooms[int(k)] = '0'
output = ''
print(output.join(rooms))


import sys
I = lambda : int(input())
RL = readline = lambda : sys.stdin.readline().strip('\n')
RM = readmap = lambda x=int: map(x, readline().split(' '))
(n, s) = (I(), RL())
l = ['0'] * 10
for i in s:
	if i == 'L':
		index = 0
		while l[index] == '1':
			index += 1
		l[index] = '1'
	elif i == 'R':
		index = 9
		while l[index] == '1':
			index -= 1
		l[index] = '1'
	else:
		l[int(i)] = '0'
print(''.join(l))


import sys
input = sys.stdin.readline
n = int(input())
S = input()
a = ['0'] * 10
for i in range(n):
	s = S[i]
	if s == 'L':
		a[a.index('0')] = '1'
	elif s == 'R':
		a = a[::-1]
		a[a.index('0')] = '1'
		a = a[::-1]
	else:
		a[int(s)] = '0'
print(''.join(a))


def traverse_and_assign_from_left(rooms):
	for (idx, room) in enumerate(rooms):
		if room == '0':
			rooms[idx] = '1'
			return rooms

def traverse_and_assign_from_right(rooms):
	for i in range(10):
		if rooms[9 - i] == '0':
			rooms[9 - i] = '1'
			return rooms

def problem():
	n = int(input())
	rooms = ['0'] * 10
	eventList = input()
	for event in eventList:
		if event == 'L':
			rooms = traverse_and_assign_from_left(rooms)
		elif event == 'R':
			rooms = traverse_and_assign_from_right(rooms)
		else:
			rooms[int(event)] = '0'
	print(''.join(rooms))
problem()


n = int(input())
s = input()
v = '0' * 10
vl = list(v)

def search_L():
	for i in range(0, 10):
		if vl[i] == '0':
			return i

def search_R():
	for i in range(-1, -11, -1):
		if vl[i] == '0':
			return i
for i in range(0, len(s)):
	if s[i] == 'L':
		vl[search_L()] = '1'
	for j in range(0, 10):
		if s[i] == str(j):
			vl[j] = '0'
	if s[i] == 'R':
		vl[search_R()] = '1'
	for j in range(0, 10):
		if s[i] == str(j):
			vl[j] = '0'
print(''.join(vl))


n = input()
mem = input()
rooms = [0] * 10
(lp, rp) = (0, 9)
for (i, ch) in enumerate(mem):
	if ch == 'L':
		while rooms[lp] == 1:
			lp += 1
		rooms[lp] = 1
	elif ch == 'R':
		while rooms[rp] == 1:
			rp -= 1
		rooms[rp] = 1
	else:
		vacate = int(ch)
		if vacate < lp:
			lp = vacate
		if vacate > rp:
			rp = vacate
		rooms[vacate] = 0
print(''.join(map(str, rooms)))


instructionsNum = int(input(''))
instructions = list(input(''))
if len(instructions) != instructionsNum:
	exit()
rooms = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']

def findIndex(x):
	if x == 'l':
		index = 0
		while rooms[index] != '0' and index < len(rooms):
			index += 1
		return index
	if x == 'r':
		index = len(rooms) - 1
		while rooms[index] != '0' and index < len(rooms):
			index -= 1
		return index
	return -1
for i in instructions:
	if i.isnumeric():
		rooms[int(i)] = '0'
	else:
		index = findIndex(i.lower())
		rooms[index] = '1'
print(''.join(rooms))


def get_left(rooms):
	i = 0
	for room in rooms:
		if room == 0:
			break
		i += 1
	return i

def get_right(rooms):
	rooms = rooms[::-1]
	i = 0
	for room in rooms:
		if room == 0:
			break
		i += 1
	return 9 - i
n = int(input())
moves = input()
rooms = [0 * i for i in range(10)]
for move in moves:
	if move == 'L':
		index = get_left(rooms)
		rooms[index] = 1
	elif move == 'R':
		index = get_right(rooms)
		rooms[index] = 1
	else:
		room = int(move)
		rooms[room] = 0
for i in rooms:
	print(i, end='')


n = int(input())
s = input()
a = list()
for i in range(10):
	a.append(0)
for i in range(n):
	if s[i] == 'L':
		for j in range(0, n):
			if a[j] == 0:
				a[j] = 1
				break
	elif s[i] == 'R':
		for j in range(9, -1, -1):
			if a[j] == 0:
				a[j] = 1
				break
	else:
		q = int(s[i])
		a[q] = 0
for i in range(10):
	print(a[i], end='')


a = [0] * 10
n = int(input())
s = input()
fl = 0
fr = 9
b = set((i for i in range(10)))
for i in range(n):
	if s[i] == 'L':
		m1 = min(b)
		b.remove(m1)
		a[m1] = 1
	elif s[i].isdigit():
		a[int(s[i])] = 0
		b.add(int(s[i]))
	else:
		m2 = max(b)
		b.remove(m2)
		a[m2] = 1
print(''.join(map(str, a)))


n = int(input())
s = input()
a = [0 for i in range(10)]
for i in s:
	if i.isdigit():
		a[int(i)] = 0
	elif i == 'L':
		i = 0
		while a[i] != 0:
			i += 1
		a[i] = 1
	else:
		i = 9
		while a[i] != 0:
			i -= 1
		a[i] = 1
print(*a, sep='')


n = int(input())
s = list(input())
my = [0] * 10
for x in range(0, n):
	if s[x] == 'L':
		for y in range(0, 10):
			if my[y] == 0:
				my[y] = 1
				break
	elif s[x] == 'R':
		for p in range(9, -1, -1):
			if my[p] == 0:
				my[p] = 1
				break
	else:
		temp = int(s[x])
		my[temp] = 0
for x in my:
	print(x, end='')


def main():
	n = input()
	val = input()
	data = [0 for i in range(0, 10)]
	for c in val:
		if c == 'L':
			for i in range(0, 10):
				if data[i] == 0:
					data[i] = 1
					break
		elif c == 'R':
			for i in range(9, -1, -1):
				if data[i] == 0:
					data[i] = 1
					break
		else:
			data[int(c)] = 0
	print(''.join([str(s) for s in data]))
main()


T_ON = 0
DEBUG_ON = 0
MOD = 998244353

def solve():
	n = read_int()
	G = [0 for _ in range(10)]
	for c in input():
		if c == 'L':
			for i in range(10):
				if G[i] is 0:
					G[i] = 1
					break
		elif c == 'R':
			for i in reversed(range(10)):
				if G[i] is 0:
					G[i] = 1
					break
		else:
			G[int(c)] = 0
	print(''.join(map(str, G)))

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


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


n = int(input())
m = input()
k = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(0, n):
	if m[i] == 'L':
		k[k.index(0)] = 1
	elif m[i] == 'R':
		k.reverse()
		k[k.index(0)] = 1
		k.reverse()
	else:
		k[int(m[i])] = 0
i = ''
for a in k:
	i += str(a)
print(i)


t = int(input())
h = list(input())
count_l = 0
count_r = 9
p = [0] * 10
for i in h:
	if i == 'L':
		while not p[count_l] == 0:
			count_l += 1
		p[count_l] = 1
		count_l += 1
	elif i == 'R':
		while not p[count_r] == 0:
			count_r -= 1
		p[count_r] = 1
		count_r -= 1
	else:
		x = int(i)
		p[x] = 0
		if count_l > x:
			count_l = x
		elif count_r < x:
			count_r = x
print(''.join((str(y) for y in p)))


import sys
input = sys.stdin.readline
from math import ceil, floor, factorial

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = int(input())
s = input().strip()
ans = [0] * 10
for i in s:
	if i == 'L':
		for j in range(10):
			if ans[j] == 0:
				ans[j] = 1
				break
	elif i == 'R':
		for j in range(9, -1, -1):
			if ans[j] == 0:
				ans[j] = 1
				break
	else:
		ans[int(i)] = 0
for i in ans:
	print(i, end='')


import sys
from collections import Counter
input = sys.stdin.readline
t = int(input())
s = input()[:-1]
res = [0] * 10
for i in range(t):
	if s[i] == 'L':
		idx = 0
		while res[idx] == 1:
			idx += 1
		res[idx] = 1
	elif s[i] == 'R':
		idx = 9
		while res[idx] == 1:
			idx -= 1
		res[idx] = 1
	else:
		res[int(s[i])] = 0
print(''.join((str(el) for el in res)))


from sys import stdin, stdout
for _ in range(1):
	n = int(stdin.readline())
	s = input()
	ans = ['0'] * 10
	for i in range(n):
		if s[i] == 'L':
			p = 0
			while p < 10:
				if ans[p] == '0':
					ans[p] = '1'
					break
				p += 1
		elif s[i] == 'R':
			for r in range(9, -1, -1):
				if ans[r] == '0':
					ans[r] = '1'
					break
		else:
			ans[int(s[i])] = '0'
	print(''.join(ans))


n = int(input())
inpt = input()
ret = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for letter in inpt:
	if letter == 'L':
		for i in range(10):
			if ret[i] == 0:
				ret[i] = 1
				break
	elif letter == 'R':
		for i in range(9, -1, -1):
			if ret[i] == 0:
				ret[i] = 1
				break
	else:
		ret[int(letter)] = 0
r = ''
for x in ret:
	r = r + str(x)
print(r)


import sys, math, bisect
from collections import defaultdict
M = 10 ** 9 + 7

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def powmod(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a *= a
		b >>= 1
	return res

def inv(a, m):
	return powmod(a, m - 2, m)

def factor(n):
	potentional_p = 3
	itog_list = {}
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			if n in itog_list:
				itog_list[n] += 1
			else:
				itog_list[n] = 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			if potentional_p in itog_list:
				itog_list[potentional_p] += 1
			else:
				itog_list[potentional_p] = 1
		potentional_p += 2
	return itog_list

def meth(lst):
	for i in range(10):
		if lst[i] == 0:
			lst[i] = 1
			break

def meth1(lst):
	for i in range(9, -1, -1):
		if lst[i] == 0:
			lst[i] = 1
			break
n = int(input())
s = input()
room = [0] * 10
for x in s:
	if x == 'L':
		meth(room)
	elif x == 'R':
		meth1(room)
	else:
		room[int(x)] = 0
for x in room:
	print(x, end='')
print()


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


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


(n, t) = (int(input()), input())
Q = []
for i in range(0, n):
	Q.append(t[i])
R = [0 for i in range(0, 10)]
for x in Q:
	if x == 'L':
		i = 0
		while R[i] != 0:
			i += 1
		R[i] = 1
	elif x == 'R':
		i = 9
		while R[i] != 0:
			i = i - 1
		R[i] = 1
	else:
		R[int(x)] = 0
for x in R:
	print(x, end='')


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


import sys

def input():
	return sys.stdin.readline()[:-1]
N = int(input())
S = input()
room = ['0'] * 10
for i in range(len(S)):
	if S[i] == 'L':
		for (i, b) in enumerate(room):
			if b == '0':
				break
		if b == '0':
			room[i] = '1'
	elif S[i] == 'R':
		for i in range(10):
			if room[9 - i] == '0':
				break
		if room[9 - i] == '0':
			room[9 - i] = '1'
	else:
		room[int(S[i])] = '0'
print(''.join(room))


i = int(input())
mi = input()
rooms = [0 for i in range(10)]

def leftIn(room_list):
	idx = room_list.index(0)
	room_list[idx] = 1

def rightIn(room_list):
	idx = room_list[::-1].index(0)
	room_list[9 - idx] = 1

def leave(room_list, idx):
	room_list[idx] = 0
for m in mi:
	if m == 'L':
		leftIn(rooms)
	elif m == 'R':
		rightIn(rooms)
	else:
		leave(rooms, int(m))
print(''.join((str(e) for e in rooms)))


n = list(map(int, input().split()))
l = list(input())
r = [0 for i in range(0, 10)]
for a in l:
	if a == 'L':
		x = 1
		i = 0
		while x != 0:
			if r[i] == 0:
				r[i] = 1
				x = 0
			i = i + 1
	elif a == 'R':
		x = 1
		i = 9
		while x != 0:
			if r[i] == 0:
				r[i] = 1
				x = 0
			i = i - 1
	elif 0 <= int(a) and int(a) <= 9:
		r[int(a)] = 0
print(''.join((str(e) for e in r)))


r = [0] * 10
input()
for c in input():
	try:
		r[int(c)] = 0
	except:
		if 'L' < c:
			r = r[::-1]
		r.remove(0)
		r = [1] + r
		if 'L' < c:
			r = r[::-1]
print(*r, sep='')


stat = [0] * 10
n = int(input())
mem = list(input())
for i in mem:
	if i == 'L':
		for j in range(0, 10):
			if stat[j] == 0:
				stat[j] = 1
				break
	elif i == 'R':
		for k in range(9, -1, -1):
			if stat[k] == 0:
				stat[k] = 1
				break
	else:
		stat[int(i)] = 0
print(*stat, sep='')


n = int(input())
s = input()
a = [0] * 10
for c in s:
	r = []
	if c == 'L':
		r = [0, 10]
	elif c == 'R':
		r = [9, -1, -1]
	else:
		a[int(c)] = 0
	if c == 'L' or c == 'R':
		for i in range(*r):
			if a[i] == 0:
				a[i] = 1
				break
print(*a, sep='')


n = int(input())
inp = input()
op = ['0'] * 10
for i in inp:
	if i == 'L':
		for j in range(10):
			if op[j] == '0':
				op[j] = '1'
				break
	elif i == 'R':
		for j in range(10):
			if op[-j - 1] == '0':
				op[-j - 1] = '1'
				break
	else:
		op[int(i)] = '0'
op = ''.join(op)
print(op)


import sys
room_state = list(''.join('0' * 10))
length = int(sys.stdin.readline())
room_actions = sys.stdin.readline()[:-1]
for action in room_actions:
	if action in ('L', 'R'):
		if action == 'R':
			room_state = room_state[::-1]
		for i in range(length):
			if room_state[i] == '0':
				room_state[i] = '1'
				break
		if action == 'R':
			room_state = room_state[::-1]
	else:
		room_state[int(action)] = '0'
room_state = ''.join(room_state)
print(room_state)


n = int(input())
l = input()
rooms = [0] * 10
for ll in l:
	l_idx = 0
	r_idx = 9
	if ll == 'L':
		while rooms[l_idx]:
			l_idx += 1
		rooms[l_idx] = 1
	elif ll == 'R':
		while rooms[r_idx]:
			r_idx -= 1
		rooms[r_idx] = 1
	else:
		rooms[int(ll)] = 0
for room in rooms:
	print(room, end='')


from sys import stdin, stdout
from collections import Counter
import math

def rsingle_int():
	return int(stdin.readline().rstrip())

def rmult_int():
	return [int(x) for x in stdin.readline().rstrip().split()]

def rmult_str():
	return stdin.readline().rstrip().split()

def r_str():
	return stdin.readline().rstrip()

def rsingle_char():
	return stdin.read(1)

def main():
	n = rsingle_int()
	mem = r_str()
	assignment = []
	for i in range(0, 10):
		assignment.append(0)
	for event in mem:
		if event.isdigit():
			assignment[int(event)] = 0
		elif event == 'R':
			for i in range(9, -1, -1):
				if assignment[i] == 0:
					assignment[i] = 1
					break
		elif event == 'L':
			for i in range(0, 10):
				if assignment[i] == 0:
					assignment[i] = 1
					break
	answer = ''
	for room in assignment:
		if room == 0:
			answer += '0'
		else:
			answer += '1'
	print(answer)
main()


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


from math import *
MOD = int(1000000000.0) + 7

def nextInt():
	return int(input())

def nextInts():
	return list(map(int, input().split()))

def YN(x):
	return 'YES' if x else 'NO'

def solve():
	N = nextInt()
	S = input()
	L = [0] * 10
	for t in S:
		if t == 'L':
			cur = 0
			while L[cur] == 1:
				cur += 1
			L[cur] = 1
		elif t == 'R':
			cur = 9
			while L[cur] == 1:
				cur -= 1
			L[cur] = 1
		else:
			L[int(t) - int('0')] = 0
	return ''.join((str(x) for x in L))
print(solve())


def myfunc(i, c):
	c[i] = 0

def myl(c):
	for i in range(0, 10):
		if c[i] == 0:
			c[i] = 1
			return

def myr(c):
	for i in range(0, 10)[::-1]:
		if c[i] == 0:
			c[i] = 1
			return
n = int(input())
b = input()
c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in b:
	if i == 'L':
		myl(c)
	elif i == 'R':
		myr(c)
	else:
		myfunc(int(i), c)
p = ''
for i in c:
	p += str(i)
print(p)


import bisect
a = int(input())
b = input()
b = list(b)
curr = [0] * 10
for i in range(a):
	if b[i] == 'L':
		ind = curr.index(0)
		curr[ind] = 1
	elif b[i] == 'R':
		ind = len(curr) - 1 - curr[::-1].index(0)
		curr[ind] = 1
	else:
		curr[int(b[i])] = 0
strans = ''
for i in curr:
	strans = strans + str(i)
print(strans)


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


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


n = int(input())
roomset = list(input())
hotel = [0] * 10
for i in roomset:
	if i == 'L':
		k = 0
		while hotel[k] == 1:
			k += 1
		hotel[k] = 1
	elif i == 'R':
		k = 9
		while hotel[k] == 1:
			k -= 1
		hotel[k] = 1
	else:
		hotel[int(i)] = 0
sol = ''
for i in hotel:
	sol += str(i)
print(sol)


size = int(input())
events_string = input()
room_status = [0] * 10
l_counter = 0
r_counter = 9
for i in range(size):
	if events_string[i] == 'L':
		j = 0
		while j < size:
			if room_status[j] == 0:
				room_status[j] = 1
				break
			j += 1
	elif events_string[i] == 'R':
		j = 9
		while j > -1:
			if room_status[j] == 0:
				room_status[j] = 1
				break
			j -= 1
	else:
		room_status[int(events_string[i])] = 0
print(*room_status, sep='')


R = [0] * 10

def Left():
	for i in range(0, 10):
		if R[i] == 0:
			R[i] = 1
			break

def Right():
	i = 9
	while i >= 0:
		if R[i] == 0:
			R[i] = 1
			break
		i -= 1
n = int(input())
s = input()
for x in s:
	if x == 'L':
		Left()
	elif x == 'R':
		Right()
	else:
		R[int(x)] = 0
for m in R:
	print(m, end='')


hotel = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
n = int(input())
g = input()
for i in g:
	if i == 'L':
		for k in range(10):
			if not hotel[k]:
				hotel[k] = 1
				break
	elif i == 'R':
		hotel.reverse()
		for k in range(10):
			if not hotel[k]:
				hotel[k] = 1
				break
		hotel.reverse()
	else:
		b = int(i)
		hotel[b] = 0
for j in hotel:
	print(j, end='')


a = int(input())
b = input()
x = list('0000000000')
for i in b:
	if i == 'L':
		x[''.join(x).find('0')] = '1'
	elif i == 'R':
		x[''.join(x).rfind('0')] = '1'
	else:
		x[int(i)] = '0'
print(''.join(x))


import sys
input = sys.stdin.readline
from collections import *
n = int(input())
s = input()[:-1]
flag = [False] * 10
for si in s:
	if si == 'L':
		for i in range(10):
			if not flag[i]:
				flag[i] = True
				break
	elif si == 'R':
		for i in range(9, -1, -1):
			if not flag[i]:
				flag[i] = True
				break
	else:
		flag[int(si)] = False
ans = []
for i in range(10):
	if flag[i]:
		ans.append('1')
	else:
		ans.append('0')
print(''.join(ans))


n = int(input())
ask = list(input())
ans = [0] * 10
for j in ask:
	if j == 'L':
		for i in range(10):
			if ans[i] == 0:
				ans[i] = 1
				break
	elif j == 'R':
		for i in range(9, -1, -1):
			if ans[i] == 0:
				ans[i] = 1
				break
	else:
		ans[int(j)] = 0
for i in ans:
	print(i, end='')


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

def left():
	for i in range(10):
		if l[i] == 0:
			return i

def right():
	for i in range(9, -1, -1):
		if l[i] == 0:
			return i
for x in s:
	if x == 'L':
		l[left()] = 1
	elif x == 'R':
		l[right()] = 1
	else:
		l[int(x)] = 0
for x in l:
	print(x, end='')


n = int(input())
events = str(input())
rooms = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
str = ''
for i in range(n):
	if events[i] == 'L':
		for i in range(n):
			if rooms[i] == '0':
				rooms[i] = '1'
				break
			else:
				continue
	elif events[i] == 'R':
		for i in range(9, -1, -1):
			if rooms[i] == '0':
				rooms[i] = '1'
				break
			else:
				continue
	else:
		rooms[int(events[i])] = '0'
for i in rooms:
	str += i
print(str)