• + 0 comments

    In Python:

    def index_characters(string):
        evens = [letter for index, letter in enumerate(string) if index % 2 == 0]
        odds = [letter for index, letter in enumerate(string) if index % 2 != 0]
        print("".join(evens), "".join(odds))
        
    if __name__ == "__main__":
        n = int(input())
        
        for _ in range(n):
            string = input()
            index_characters(string)