<reponame>pavi-ninjaac/HackerRank<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 13 21:45:12 2020

@author: ninjaac
"""


"""
You are given a string  and width .
Your task is to wrap the string into a paragraph of width .

Input Format

The first line contains a string, .
The second line contains the width, .

Constraints

Output Format

Print the text wrapped paragraph.

Sample Input 0

ABCDEFGHIJKLIMNOQRSTUVWXYZ
4
Sample Output 0

ABCD
EFGH
IJKL
IMNO
QRST
UVWX
YZ

"""
import textwrap

def wrap(string, max_width):
    
    return '\n'.join(textwrap.wrap(string,max_width))

if __name__ == '__main__':
    string, max_width = input(), int(input())
    result = wrap(string, max_width)
    print(result)


# -*- coding: utf-8 -*-
"""
Created on Tue Oct 13 21:45:12 2020

@author: ninjaac
"""


"""
You are given a string  and width .
Your task is to wrap the string into a paragraph of width .

Input Format

The first line contains a string, .
The second line contains the width, .

Constraints

Output Format

Print the text wrapped paragraph.

Sample Input 0

ABCDEFGHIJKLIMNOQRSTUVWXYZ
4
Sample Output 0

ABCD
EFGH
IJKL
IMNO
QRST
UVWX
YZ

"""
import textwrap

def wrap(string, max_width):
    
    return '\n'.join(textwrap.wrap(string,max_width))

if __name__ == '__main__':
    string, max_width = input(), int(input())
    result = wrap(string, max_width)
    print(result)
# -*- coding: utf-8 -*- Created on Tue Oct 13 21:45:12 2020
 
 @author: ninjaac You are given a string  and width .
 Your task is to wrap the string into a paragraph of width .
 
 Input Format
 
 The first line contains a string, .
 The second line contains the width, .
 
 Constraints
 
 Output Format
 
 Print the text wrapped paragraph.
 
 Sample Input 0
 
 ABCDEFGHIJKLIMNOQRSTUVWXYZ
 4
 Sample Output 0
 
 ABCD
 EFGH
 IJKL
 IMNO
 QRST
 UVWX
 YZ