Buggy python submission (verdict: Runtime Error):
def signal(a,e):
	s=""
	for i in range(7):
		s+="0" if a[i]==e[i] else "1"
	return s
		

ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
	n=input()
	if n==-1:break
	e="0000000"
	for i in range(n):
		a=ref[int(raw_input())]
		print signal(a,e)
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
def signal(a,e):
	s=""
	for i in range(7):
		s+="0" if a[i]==e[i] else "1"
	return s
		

ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
	n=input()
	if n==-1:break
	e="0000000"
	for i in range(n):
		a=ref[int(raw_input())]
		print signal(a,e)
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
def signal(a,e):
	s=""
	for i in range(7):
		s+="0" if a[i]==e[i] else "1"
	return s

ref=["0111111","0000110","1011011","1001111","1100110","1101101","1111101","0100111","1111111","1101111"]
while 1:
	n=int(raw_input())
	if n==-1:break
	e="0000000"
	for i in range(n):
		a=ref[int(raw_input())]
		print signal(a,e)
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=input()
	if n==-1:break
	e=0
	for i in range(n):
		a=ref[int(raw_input())]
		print "{:07b}".format(a^e)
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=input()
	if n==-1:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n==-1:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n==10:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n<0:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n==-1:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n+1==0:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n==0:break
	e=0
	for i in range(n):
		a=ref[int(raw_input())]
		print "{:07b}".format(a^e)
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n<=0:break
	e=0
	for i in range(n):
		a=ref[int(raw_input())]
		print "{:07b}".format(a^e)
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
loop do
  n =gets.to_i
  break if n==-1
end

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n==-1:
		break
	e=0
	for i in range(n):
		a=ref[int(raw_input())]
		print ("{:07b}".format(a^e))
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n==-1:break
	e=0
	for i in range(n):
		a=ref[int(raw_input())]
		print "{:07b}".format(a^e)
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n==-1:break
	e=0
	for i in range(n):
		a=ref[int(raw_input())]
		print "{:07b}".format(a^e)
		e=a

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass

Buggy python submission (verdict: Runtime Error):
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=int(raw_input())
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[int(raw_input())]
			print "{:07b}".format(a^e)
			e=a
	except SyntaxError:
		pass

Fixed submission:
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass