# include <bits/stdc++.h>
using namespace std ;
# define ll long long
# define fs first
# define sc second
# define pll pair<long, long>
# define pii pair<int, int>
int main() {
ll int n, s ;
cin >> n ;
while ( n-- ) {
cin >> s ;
cout << pow(s+1, 2) - 1 << "\n" ; // 計算後的公式,記得分子分母同乘( a^2 - b^2 = (a - b)(a + b) )
}
return 0 ;
}
IyBpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkIDsKCiMgZGVmaW5lIGxsIGxvbmcgbG9uZwojIGRlZmluZSBmcyBmaXJzdAojIGRlZmluZSBzYyBzZWNvbmQKIyBkZWZpbmUgcGxsIHBhaXI8bG9uZywgbG9uZz4KIyBkZWZpbmUgcGlpIHBhaXI8aW50LCBpbnQ+CgppbnQgbWFpbigpIHsKICAgIGxsIGludCBuLCBzIDsKICAgIGNpbiA+PiBuIDsKICAgIHdoaWxlICggbi0tICkgewogICAgICAgIGNpbiA+PiBzIDsKICAgICAgICBjb3V0IDw8IHBvdyhzKzEsIDIpICAtIDEgPDwgIlxuIiA7IC8vIOioiOeul+W+jOeahOWFrOW8j++8jOiomOW+l+WIhuWtkOWIhuavjeWQjOS5mCggYV4yIC0gYl4yID0gKGEgLSBiKShhICsgYikgKQogICAgfQogICAgcmV0dXJuIDAgOwp9CiAgICA=