#include<stdio.h>
void main()
{
int c, n, i;
long long sum;
while (~scanf_s("%d", &c))
{
while (c--)
{
scanf_s("%d", &n); sum = 0;
sum = 2 * n * n - n + 1;
printf("%lld\n", sum);
}
}
}
12-29
646
03-07
304