WARMSG - War Message

Naruto wants to inform about the the battle's current condition to headquarter at New York, NY 10017, United States, so he sends a message in encoded form so that it may not be misused. Help him...

You will be given a string S (containing letters, numbers and special characters - any symbol present in keyboard) and a number n and you have to decode it with the following rules...

  • Print the string starting from the first letter.
  • Jump n letters at a time. //after that subsequent nth letter will be printed until you reach the end.
  • After reaching the end start printing from the second letter and then follow the 2nd rule... and go so on.
  • Stop printing when all the letters of the string have been printed. Tongue out

Input

First line consist t (t <= 100) number of test cases. Each test case includes a string S (|S| <= 1000) and a number n (1 <= n <= 10^12) separated by space.

Output

Output a single line for each test case consisting of required string (string should contain only small letters) and the number of times the string have been traversed.

Example

Input:
3
AnkIt 3
RiddHi 2
ShuBHAnkAr 3

Output:
aintk 3
rdhidi 2
sbnrhhkuaa 3

Added by:`Ak
Date:2014-11-02
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.