import sys for i in range(int(input())): text = sys.stdin.readline().rstrip("\n") print(text[0] + text[len(text) - 1])
기본적으로 버퍼에서 받아오므로 '\n'이 함께 딸려온다 -> 때문에 반복문에서 많이 사용되어야 이점이 생긴다.