var
a,b,d,n,m,l:longint;
c:char;
s:string;
z:array[1..33]of integer;
begin
assign(input,'testled.in');
assign(output,'testled.out');
reset(input);
rewrite(output);
readln(l);
readln(s);
for a:=l downto 1 do
z[a]:=(ord(s[a])-48);
readln(n);
for a:=1 to n do
begin
read(c);
if c='a' then
for b:=1 to l do
z[b]:=1;
if c='b' then
for b:=1 to l do
z[b]:=0;
if c='c' then
for b:=1 to l do
if z[b]=1 then z[b]:=0
else z[b]:=1;
if c='1' then
for b:=1 to l do
if b mod 2=0 then z[b]:=(z[b]+1)mod 2;
if c='2' then
for b:=1 to l do
if b mod 2=1 then z[b]:=(z[b]+1)mod 2;
if (c>'2')and(c<='9') then
begin
for b:=1 to ord(c)-48 do
z[b]:=0;
for b:=l downto l-(ord(c)-48)+1 do
z[b]:=1;
end;
end;
for a:=1 to l do
write(z[a]);
writeln;
close(input);close(output);
end.