#include #include using namespace atcoder; using namespace std; using ll=long long; using ld=double; ld pie=3.14159265359; ll mod=998244353; ll inf=100000001; int main(){ ll t; cin >> t; for (ll o = 0; o < t; o++) { ll n; cin >> n; cout << 2+(n+2)*(n-1) << endl; } }