def gray_to_binary(n):
	"""Convert Gray codeword to binary and return it"""
	mask=n=int(n,2) # Convert to int
	while mask != 0:
		mask >>= 1
		n ^= mask
	return bin(n)[2:]
		# bin(n) returns n's binary representation with a '0b' prefixed
                                # the slice operation is to remove the prefix