View on GitHub

30daysofcode

Try a new challenge every day for 30 days. By the end of the month, you'll go from newbie to expert.

Day 6 - Review

Objective

Today we’re expanding our knowledge of Strings and combining it with what we’ve already learned about loops.

Task

Given a string, S, of length N that is indexed from 0 to N-1, print its even-indexed and odd-indexed characters as 2 space-separated strings on a single line (see the Sample below for more detail).

Note: 0 is considered to be an even index.

Input Format

The first line contains an integer, T (the number of test cases). 
Each line i of the T subsequent lines contain a String, S.

Constraints

1<=T<=100
2<=length of S<=10000

Output Format

For each String, S, print it's even-indexed characters, followed by a space, followed by it's odd-indexed characters.

Sample Input

2
Hacker
Rank

Sample Output

Hce akr
Rn ak