open Scanf
open Printf

let id a = a
let pair a b = a, b
let triplet a b c = a, b, c

let rec scan_list = function
  | 1 -> scanf "%d" (fun k -> [k])
  | n -> scanf "%d " (fun k -> k :: scan_list (n-1))

let f s w = let rec g k = if k < String.length s
              then begin
                printf "%c" (String.get s k);
                g (k+w)
              end
              else printf "\n"
  in g 0

let () = scanf "%s\n%d\n" f