testtt5_13797
A robot named as Maestro, works on right most digit of number. For eg. 123456 is a number. Maestro would work with 6. But now, if number is 12345600. It will work with  6.  

Input Specification

Input a variable t which is the number of test cases. Then input a string having alternate integers and multiplication characters. Your job is to calculate the last non zero digit in that mathematical expression.
Number can be as large as 10^19.
                         0 < t


Output Specification
Output consists of a single number which is the last non zero digit of the value of the expression.
If the expression evaluates to be zero, output should be “Robot hanged.”


Example

Sample Input:
2
2X3X7X5
2X0X4X25


Sample Output:
1
Robot hanged.
testcase = int(raw_input())

while testcase > 0:
 
	input = raw_input()
	numbers = input.replace("x","*")
	numbers = numbers.replace("X","*")
	#print numbers
	result = eval(numbers)
	
	if (result == 0):
		print "Robot hanged."
	
	else:
		 print str(result).rstrip("0")[-1]
		
	testcase -= 1