T = int(input()) for _ in range(T): X = int(input()) if X % 6 == 0: print(4 * X) elif X % 2 == 0: print(3 * X) else: print(2 * X)