from typing import Tuple


def decode_pair(z: int) -> Tuple[int, int]:
	"""Return left and right given a pair encoding"""
	x, y = 0, z
	# divide y by 2 until it is even
	while y % 2 != 0:
		x += 1
		y = y // 2
	# x is the power of 2
	# y is half of the remaining even number
	return x, y // 2