P26998 [AtCoder] Acrostic
入门
题目描述

Problem Description

Given a string $ S $ consisting of lowercase alphabets, when the string is broken into lines every $ w $ characters, output the string obtained by concatenating the first characters of each line from top to bottom.

Input Format

The input is given from the standard input in the following format:

$ S $ $ w $

Output Format

Output the resulting string in one line.

Sample Input and Output

Sample Input #1

abcdefgh
3

Sample Output #1

adg

Sample Input #2

lllll
1

Sample Output #2

lllll

Sample Input #3

souuundhound
2

Sample Output #3

suudon

Notes/Hints

Constraints

  • $1 \leq w \leq |S| \leq 1000$
  • $ S $ consists only of lowercase alphabets
  • $ w $ is an integer

Sample Explanation 1

When abcdefgh is broken into lines every 3 characters, it becomes abc def gh. Reading the first characters of each line from top to bottom gives adg.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
abcdefgh 3
样例输出
adg