﻿using System;
using System.Text;

public class Substring
{
    public static void Main()
    {
        string text = Console.ReadLine();
        int count = int.Parse(Console.ReadLine());

        const char Search = 'p';

        bool hasMatch = false;

        for (int i = 0; i < text.Length; i++)
        {
            if (text[i].ToString().CompareTo(Search.ToString()) == 0)
            {
                hasMatch = true;

                int endIndex = count + 1;

                if (i + endIndex > text.Length)
                {
                    endIndex = text.Length - i;
                }

                string matchedString = text.Substring(i, endIndex);
                Console.WriteLine(matchedString);
                i += count;
            }
        }

        if (!hasMatch)
        {
            Console.WriteLine("no");
        }
    }
}
