# -*- coding: utf-8 -*-
# Не правильная версия

import threading, time, sys

killed = False

lock = threading.Lock()

def x(n):
  global lock
  print(n, "started")
  while not killed:
    lock.acquire() 
    print(n)
    lock.release()

threading.Thread(target=x, args=[1]).start()
threading.Thread(target=x, args=[2]).start()

sys.stdin.readline()
killed = True