var s:array[1..10000] of char;
    code: array[1..10000] of char;
    n,i,d,u,p,ls,lc: integer;

begin
	Readln(n);
		
	while (n <> 0) do
	begin
	 read(s[1]);
	 i:=2;
//	 readln(s);
	 while ord(s[i-1])>64 do begin Read(s[i]); if s[i]<>' ' then inc(i); end;
	 ls:=i-2;
	for i:= 1 to ls do
	begin
//		if s[i] = ' ' then delete(s,i,1);
		if ( ord(s[i]) >= ord('a') ) and ( ord(s[i]) <= ord('z') )then
			s[i] := char(ord(s[i]) - (ord('a') - ord('A')));
	end;
	
//	d := length(s);
	d := ls;
	if (d < n) then
		WriteLn(s)
	else
		begin
		u := 1; p := 1;
		for i:= 1 to d do
		if u > d then begin
			      Inc(p);
			      u := p;
			      code[u] := s[i];
			      Inc(u,n);
 			      end
                         else begin
			      code[u] := s[i];
			      Inc(u,n);
			      end;
		for i:=1 to d do write(code[i]);
		writeln;
		end;
	Readln(n);
	end;		
end.
