var
n, i, j, k1, k2, kk : integer;
a : array [1..10] of integer;
s : string;
t : array [1..10] of string;
begin
assign(input,'input.txt'); reset(input);
assign(output,'output.txt'); rewrite(output);
readln(n);
for i:=1 to n do read(a[i]);readln;
readln(s);
k1:=length(s) div n;
k2:=length(s)-k1*n;
for i:=1 to n do
begin
if a[i]>k2 then kk:=k1 else kk:=k1+1;
t[a[i]]:=copy(s,1,kk);
delete(s,1,kk)
end;
for i:=1 to k1 do for j:=1 to n do s:=s+t[j][i];
for j:=1 to k2 do s:=s+t[j][k1+1];
writeln(s)
end.
n, i, j, k1, k2, kk : integer;
a : array [1..10] of integer;
s : string;
t : array [1..10] of string;
begin
assign(input,'input.txt'); reset(input);
assign(output,'output.txt'); rewrite(output);
readln(n);
for i:=1 to n do read(a[i]);readln;
readln(s);
k1:=length(s) div n;
k2:=length(s)-k1*n;
for i:=1 to n do
begin
if a[i]>k2 then kk:=k1 else kk:=k1+1;
t[a[i]]:=copy(s,1,kk);
delete(s,1,kk)
end;
for i:=1 to k1 do for j:=1 to n do s:=s+t[j][i];
for j:=1 to k2 do s:=s+t[j][k1+1];
writeln(s)
end.