/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.Scanner; /** * * @author louma */ public class encipher { public static void main(String[] args) { Scanner a = new Scanner(System.in); while (true) { String line = a.nextLine(); if (line.equals("0") == true) break; short posun = Short.parseShort(line); String text = a.nextLine().replace(" ", "").toUpperCase(); if (posun >= text.length()) { System.out.println(text); continue; } char[] vystup = text.toCharArray(); //System.out.printf("%d\n", text.length()); int k = 0; for (int i = 0, j = 0; j < text.length(); i = (i + posun), j++) { if (i >= vystup.length) i = ++k; //System.out.printf("%d -> %d\n", i, j); vystup[i] = text.charAt(j); } System.out.println(new String(vystup)); } } }