from random import randint
def start():
	game_count=0
	print(.format(game_count))
	roundno=1
	while game_count<21:
		print(.format(roundno))
		t = select_count(game_count)
		game_count = game_count+t
		print(.format(game_count))
		if game_count>=21:
			print()
			return 0
		t = request_count()
		if not t:
			print('OK,quitting the game')
			return -1
		game_count = game_count+t
		print(.format(game_count))
		if game_count>=21:
			print()
			return 1
		roundno+=1

def select_count(game_count):
	'''selects a random number if the game_count is less than 18. otherwise chooses the winning number'''
	if game_count<18:
		t= randint(1,3)
	else:
		t = 21-game_count
	print(.format(t))
	return t

def request_count():
	'''request user input between 1,2 and 3. It will continue till either quit(q) or one of those numbers is requested.'''
	t=
	while True:
		try:
			t = raw_input('Your choice 1 to 3:')
			if int(t) in [1,2,3]:
				return int(t)
			else:
				print()
		except:
			if t==:
				return None
			else:
				print()

c=0
m=0
r=True
while r:
	o = start()
	if o==-1:
		break
	else:
		c+=1 if o==0 else 0
		m+=1 if o==1 else 0
	print(.format(c,m))
	t = raw_input()
	r = (t==)