while True: try: list1 = list(map(int, input().split(" "))) num, head, list_cs, tail = list1[0], list1[1], [],&nbs...