import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class encipher
{

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int n;
//		this is a secret message that noone should ever see lets encript it 
//		CTU Open Programming Contest
//		text too short
		while(true)
		{
			s = br.readLine();
			n = Integer.valueOf(s);
			if (n == 0) break;
			s = br.readLine();
			
			s = s.toUpperCase();
			s = s.trim();
			s = s.replaceAll(" ", "");
			
			if (n > s.length())
			{
				System.out.println(new String(s));
			}
			else
			{
			
			char[] pole = new char[s.length()];
			
			int pom1 = 0;
			int pom2 = 0;
			
			while (pom2 < s.length()) 
			{
				pole[pom1] = (s.charAt(pom2));
				pom1 = (pom1 + (n))%s.length();
				pom2++;
			}
			
			System.out.println(new String(pole));
			}
		}

	}

}
