# -*- coding: utf-8 -*- import sys while 1: line = sys.stdin.readline().strip() if line: a = line else: break n = len(a) last = '' while last != a: last = a for i in range(n-...