1 var
2 i,j,k,l,m,n,f,r:longint;
3 a:array[0..500000] of longint;
4 function getpx:longint;
5 var c1:char;i,j,k,l:longint;
6 begin
7 i:=0;j:=0;
8 repeat
9 read(c1);
10 if i=0 then
11 begin if c1=‘A‘ then i:=1 else if c1=‘D‘ then i:=2 end
12 else begin if c1=‘L‘ then j:=1 else if c1=‘R‘ then j:=2; end;
13 until j>0;
14 exit((i-1)*2+j);
15 end;
16 begin
17 readln(n);m:=0;f:=200000;r:=199999;
18 for i:=1 to n do
19 begin
20 case getpx of
21 1:begin inc(m);dec(f);a[f]:=m; end;
22 2:begin inc(m);inc(r);a[r]:=m; end;
23 3:begin read(j);inc(f,j); end;
24 4:begin read(j);dec(r,j); end;
25 end;
26 readln;
27 end;
28 for i:=f to r do writeln(a[i]);
29 readln;
30 end.