Start: Apr, 17, 2017 10:00:00
Python程序设计基础培训第四次作业
End: Apr, 23, 2017 14:00:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 143ms
Memory: 21428kB
Author: 13185217161
In contest: 1088

while True:
	try:
		i,s,b,n=map(str,raw_input().strip().split('-'))
		x=i+s+b
		li=[i,s,b]
		s=0
		k=1
		for j in range(len(x)):
			s+=int(x[j])*k
			k+=1
		ys=s%11
		if (ys==10 and n=='X') or (str(ys)==n):
			print 'Right'
		else:
			lj='-'
			if ys==10:
				li.append('X')
			else:
				li.append(str(s%11))
			print lj.join(li)
	except EOFError:
		break