import sys input = sys.stdin.readline t = int(input()) for tests in range(t): N = int(input()) print(2*N+N*(N-1))