A - Chompers Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MiB

配点 : 100

問題文

英小文字からなる文字列 S と正の整数 N が与えられます。S の長さは 2N+1 以上です。

S の先頭と末尾から N 文字ずつ取り除いて得られる文字列を求めてください。

制約

  • S は英小文字からなる文字列
  • N は整数
  • 2N+1 \leq |S| \leq 30
  • 1 \leq N \leq 10

入力

入力は以下の形式で標準入力から与えられる。

S
N

出力

答えを出力せよ。


入力例 1

chemotherapy
3

出力例 1

mother

chemotherapy の先頭 3 文字 (che) と末尾 3 文字 (apy) を取り除くと、mother が得られます。


入力例 2

thermometer
4

出力例 2

mom

入力例 3

burger
1

出力例 3

urge

Score : 100 points

Problem Statement

You are given a string S consisting of lowercase English letters and a positive integer N. The length of S is at least 2N+1.

Find the string obtained by removing N characters from the beginning and N characters from the end of S.

Constraints

  • S is a string consisting of lowercase English letters.
  • N is an integer.
  • 2N+1 \leq |S| \leq 30
  • 1 \leq N \leq 10

Input

The input is given from Standard Input in the following format:

S
N

Output

Output the answer.


Sample Input 1

chemotherapy
3

Sample Output 1

mother

Removing the first three characters (che) and the last three characters (apy) from chemotherapy gives mother.


Sample Input 2

thermometer
4

Sample Output 2

mom

Sample Input 3

burger
1

Sample Output 3

urge