//libraries begin
#include<bits/stdc++.h>
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<utility>
#include<set>
#include<iterator>
#include <cctype>
//libaries end

//selfddefined macros begin
#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define forn(i, n) for (ll i = 0; i < ll(n); i++)
#define for1(i, n) for (ll i = 1; i <= ll(n); i++)
#define s_s stable_sort
#define ss sort
#define endl "\n"
typedef long long ll;

//selfdefined macros end

using namespace std;
const ll N=1e9;

int32_t main()
{

 fio;
 ll t;
 cin>>t;
 while(t--)
 {
   ll n,move=1,ans=0;
   cin>>n;
   for(ll i=3;i<=n;i+=2)
   {
     ans=move*(i*i-(i-2)*(i-2));
     move++;
   }
 cout<<ans<<endl;
 }
return 0;
}


//libraries begin
#include<bits/stdc++.h>
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<utility>
#include<set>
#include<iterator>
#include <cctype>
//libaries end

//selfddefined macros begin
#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define forn(i, n) for (ll i = 0; i < ll(n); i++)
#define for1(i, n) for (ll i = 1; i <= ll(n); i++)
#define s_s stable_sort
#define ss sort
#define endl "\n"
typedef long long ll;

//selfdefined macros end

using namespace std;
const ll N=1e9;

int32_t main()
{

 fio;
 ll t;
 cin>>t;
 while(t--)
 {
   ll n,move=1,ans=0;
   cin>>n;
   for(ll i=3;i<=n;i+=2)
   {
     ans+=move*(i*i-(i-2)*(i-2));
     move++;
   }
 cout<<ans<<endl;
 }
return 0;
}


//libraries begin
#include<bits/stdc++.h>
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<utility>
#include<set>
#include<iterator>
#include <cctype>
//libaries end

//selfddefined macros begin
#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define forn(i, n) for (ll i = 0; i < ll(n); i++)
#define for1(i, n) for (ll i = 1; i <= ll(n); i++)
#define s_s stable_sort
#define ss sort
#define endl "\n"
typedef long long ll;

//selfdefined macros end

using namespace std;
const ll N=1e9;

int32_t main()
{

 fio;
 ll t;
 cin>>t;
 while(t--)
 {
   ll n,move=1,ans=0;
   cin>>n;
   for(int i=3;i<=n;i+=2)
   {
     ans=move*(i*i-(i-2)*(i-2));
     move++;
   }
 cout<<ans<<endl;
 }
return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define ll long long
#define endl '\n'
#define CASES int tt;cin>>tt; while(tt--)
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main() {
    SPEED;
    CASES {
        int n;
        cin >> n;
        int mid = n/2;
        ll answer = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                //cout << max(abs(mid-i),abs(mid-j)) << endl;
                answer = 1*ll(answer) + (max(abs(mid-i),abs(mid-j)));
                //cout << max(abs(mid-i),abs(mid-j)) << " " << answer << endl;
            }
        }
        cout << answer << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define ll long long
#define endl '\n'
#define CASES int tt;cin>>tt; while(tt--)
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main() {
    SPEED;
    CASES {
        int n;
        cin >> n;
        int m = n/2;
        ll answer = (1ll*m*(m+1)*(2*m+1)*8)/6;
        cout << answer << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define ll long long
#define endl '\n'
#define CASES int tt;cin>>tt; while(tt--)
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main() {
    SPEED;
    CASES {
        int n;
        cin >> n;
        cout << (1ll*((n-1)/2)*(((n-1)/2)+1)*(2*((n-1)/2)+1)*8)/6 << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define ll long long
#define endl '\n'
#define CASES int tt;cin>>tt; while(tt--)
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main() {
    SPEED;
    CASES {
        int n;
        cin >> n;
        int mid = n/2;
        ll answer = 0;
        for (int i = 0; i < mid; i++) {
            for (int j = 0; j < n; j++) {
                answer = 1ll*(answer) + (max(abs(mid-i),abs(mid-j)));
            }
        }
        answer*=2;
        for (int i = 0; i < n; i++) {
            answer = 1ll*(answer) + (abs(i-mid));
            //cout << abs(i-mid) << " " << answer << endl;
        }
        cout << answer << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define ll long long
#define endl '\n'
#define CASES int tt;cin>>tt; while(tt--)
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main() {
    SPEED;
    CASES {
        int n;
        cin >> n;
        int mid = n/2;
        ll answer = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                //cout << max(abs(mid-i),abs(mid-j)) << endl;
                answer = 1ll*(answer) + (max(abs(mid-i),abs(mid-j)));
                //cout << max(abs(mid-i),abs(mid-j)) << " " << answer << endl;
            }
        }
        cout << answer << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
const ll M=1000000007;
ll power(ll x,ll n){if(n==0)return 1;else if(n%2==0)return (power((x*x)%M,n/2))%M;else return ((x%M)*power(x,n-1)%M);}
ll ncr(int n,int r){if(r>n)return 0;if(r > n - r) r = n - r;ll ans = 1;
int i;for(i = 1; i <= r; i++){ans *= n - r + i;ans /= i;}return ans;}
ll nCrModpDP(ll n, ll r, ll p){
    ll C[r+1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++){
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j-1])%p;
    }
    return C[r];
}
ll ncrmod(ll n, ll r, ll p){
   if (r==0)
      return 1;
   ll ni = n%p, ri = r%p;
   return (ncrmod(n/p, r/p, p) *
           nCrModpDP(ni, ri, p)) % p;
}
ll modInverse(ll a,ll m)
{
   ll m0 = m;
   ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
       ll q = a / m;
       ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;

    return x;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
ll n,sum=0,k;
cin>>t;
for(int j=0; j<t; j++){
cin>>n;
if(n==1)
cout<<"0"<<"\n";
else if(n==3)
cout<<"1"<<"\n";
else{
ll i=1;
ll te=(n*n)-1;
ll sum=8*((i*(i+1))/2);
while(sum<te){
sum=8*((i*(i+1))/2);
i++;
}
ll y=i-1;
cout<<8*((y*(y+1)*(2*y+1))/6)<<"\n";
}
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
const ll M=1000000007;
ll power(ll x,ll n){if(n==0)return 1;else if(n%2==0)return (power((x*x)%M,n/2))%M;else return ((x%M)*power(x,n-1)%M);}
ll ncr(int n,int r){if(r>n)return 0;if(r > n - r) r = n - r;ll ans = 1;
int i;for(i = 1; i <= r; i++){ans *= n - r + i;ans /= i;}return ans;}
ll nCrModpDP(ll n, ll r, ll p){
    ll C[r+1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++){
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j-1])%p;
    }
    return C[r];
}
ll ncrmod(ll n, ll r, ll p){
   if (r==0)
      return 1;
   ll ni = n%p, ri = r%p;
   return (ncrmod(n/p, r/p, p) *
           nCrModpDP(ni, ri, p)) % p;
}
ll modInverse(ll a,ll m)
{
   ll m0 = m;
   ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
       ll q = a / m;
       ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;

    return x;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
ll n,sum=0,k;
cin>>t;
for(int j=0; j<t; j++){
cin>>n;
if(n==1)
cout<<"0"<<"\n";
else{
ll i=1,j=1;
ll te=(n*n)-1;
ll sum=8*((i*(i+1))/2);
while(sum<te){
sum=8*((i*(i+1))/2);
i++;
}
ll y=i-1;
cout<<8*((y*(y+1)*(2*y+1))/6)<<"\n";
}
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
const ll M=1000000007;
ll power(ll x,ll n){if(n==0)return 1;else if(n%2==0)return (power((x*x)%M,n/2))%M;else return ((x%M)*power(x,n-1)%M);}
ll ncr(int n,int r){if(r>n)return 0;if(r > n - r) r = n - r;ll ans = 1;
int i;for(i = 1; i <= r; i++){ans *= n - r + i;ans /= i;}return ans;}
ll nCrModpDP(ll n, ll r, ll p){
    ll C[r+1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++){
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j-1])%p;
    }
    return C[r];
}
ll ncrmod(ll n, ll r, ll p){
   if (r==0)
      return 1;
   ll ni = n%p, ri = r%p;
   return (ncrmod(n/p, r/p, p) *
           nCrModpDP(ni, ri, p)) % p;
}
ll modInverse(ll a,ll m)
{
   ll m0 = m;
   ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
       ll q = a / m;
       ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;

    return x;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
ll n,sum=0,k;
cin>>t;
for(int j=0; j<t; j++){
cin>>n;
if(n==1)
cout<<"0"<<"\n";
else if(n==3)
cout<<"8"<<"\n";
else{
ll i=1;
ll te=(n*n)-1;
ll sum=8*((i*(i+1))/2);
while(sum<te){
sum=8*((i*(i+1))/2);
if(sum>te){
sum-=8*((i*(i+1))/2);
break;
}
i++;
}
ll dif=0;
if(sum<te){
dif=(te-sum)*i;
}
ll y=i-1;
cout<<(8*((y*(y+1)*(2*y+1))/6))+dif<<"\n";
}
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
const ll M=1000000007;
ll power(ll x,ll n){if(n==0)return 1;else if(n%2==0)return (power((x*x)%M,n/2))%M;else return ((x%M)*power(x,n-1)%M);}
ll ncr(int n,int r){if(r>n)return 0;if(r > n - r) r = n - r;ll ans = 1;
int i;for(i = 1; i <= r; i++){ans *= n - r + i;ans /= i;}return ans;}
ll nCrModpDP(ll n, ll r, ll p){
    ll C[r+1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++){
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j-1])%p;
    }
    return C[r];
}
ll ncrmod(ll n, ll r, ll p){
   if (r==0)
      return 1;
   ll ni = n%p, ri = r%p;
   return (ncrmod(n/p, r/p, p) *
           nCrModpDP(ni, ri, p)) % p;
}
ll modInverse(ll a,ll m)
{
   ll m0 = m;
   ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
       ll q = a / m;
       ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;

    return x;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
ll n,sum=0,k;
cin>>t;
for(int j=0; j<t; j++){
cin>>n;
if(n==1)
cout<<"0"<<"\n";
else{
ll i=1;
ll te=(n*n)-1;
ll sum=8*((i*(i+1))/2);
while(sum<te){
sum=8*((i*(i+1))/2);
i++;
}
ll y=i-1;
cout<<8*((y*(y+1)*(2*y+1))/6)<<"\n";
}
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
const ll M=1000000007;
ll power(ll x,ll n){if(n==0)return 1;else if(n%2==0)return (power((x*x)%M,n/2))%M;else return ((x%M)*power(x,n-1)%M);}
ll ncr(int n,int r){if(r>n)return 0;if(r > n - r) r = n - r;ll ans = 1;
int i;for(i = 1; i <= r; i++){ans *= n - r + i;ans /= i;}return ans;}
ll nCrModpDP(ll n, ll r, ll p){
    ll C[r+1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++){
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j-1])%p;
    }
    return C[r];
}
ll ncrmod(ll n, ll r, ll p){
   if (r==0)
      return 1;
   ll ni = n%p, ri = r%p;
   return (ncrmod(n/p, r/p, p) *
           nCrModpDP(ni, ri, p)) % p;
}
ll modInverse(ll a,ll m)
{
   ll m0 = m;
   ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
       ll q = a / m;
       ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;

    return x;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
ll n,sum=0,k;
cin>>t;
for(int j=0; j<t; j++){
cin>>n;
if(n==1)
cout<<"0"<<"\n";
else if(n==3)
cout<<"8"<<"\n";
else{
ll i=1;
ll te=(n*n)-1;
ll sum=8*((i*(i+1))/2);
while(sum<te){
sum=8*((i*(i+1))/2);
if(sum>te){
sum-=8*((i*(i+1))/2);
break;
}
i++;
}
ll dif=0;
if(sum<te){
dif=(te-sum)*i;
}
ll y=i-1;
cout<<(8*((y*(y+1)*(2*y+1))/6))+dif<<"\n"<<dif<<"\n";
}
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	cin>>t;
	long long int ans,n;
	for(int j=0;j<t;j++)
	{
		cin>>n;
		n/=2;
		ans = 8*((n*(n+1)*(2*n+1))/6);
		cout<<ans<<"\n";
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,n;
	cin>>t;
	for(int j=0;j<t;j++)
	{
		cin>>n;
		n/=2;
		cout<<8*((n*(n+1)*(2*n+1))/6);
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,n;
	cin>>t;
	long long int ans;
	for(int j=0;j<t;j++)
	{
		cin>>n;
		n/=2;
		ans = 8*((n*(n+1)*(2*n+1))/6);
		cout<<ans<<"\n";
	}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t,n;
	cin>>t;
	for(int j=0;j<t;j++)
	{
		cin>>n;
		n/=2;
		cout<<8*((n*(n+1)*(2*n+1))/6)<<"\n";
	}
}


#include <iostream>
#include <vector>
using namespace std;
#include <bits/stdc++.h>
int main()
{
int test;

int moves,n;
int val;
   for(int i=0;i<test;i++)
  {
    cin>>n;
    int s=0;
    int temp=0;
    for(int j=0;j<(n+1)/2;j++)
    {
       s=s+(temp*j);
       temp=temp+8
    }
    cout<<s;
   }
return 0;
}


#include <iostream>
#include <vector>
using namespace std;
#include <bits/stdc++.h>
int main()
{
long long int test;

long long int n;
   for(long long int i=0;i<test;i++)
  {
    cin>>n;
    long long int s=0;
    long long int temp=0;
    for(long long int j=0;j<(n+1)/2;j++)
    {
       s=s+(temp*j);
       temp=temp+8;
    }
    cout<<s<<"\n";
   }
return 0;
}


#include <iostream>
#include <vector>
using namespace std;
#include <bits/stdc++.h>
int main()
{
int test;

int moves,n;
int val;
   for(int i=0;i<test;i++)
  {
    cin>>n;
    int s=0;
    int temp=0;
    for(int j=0;j<(n+1)/2;j++)
    {
       s=s+(temp*j);
       temp=temp+8;
    }
    cout<<s;
   }
return 0;
}


#include <iostream>
#include <vector>
using namespace std;
#include <bits/stdc++.h>
int main()
{
long long int test;

long long int n;
   for(long long int i=0;i<test;i++)
  {
    cin>>n;
    long long int s=0;
    long long int temp=0;
    for(long long int j=0;j<(n+1)/2;j++)
    {
       s=s+(temp*j);
       temp=temp+8;
    }
    cout<<s;
   }
return 0;
}


#include <iostream>
#include <vector>
using namespace std;
#include <bits/stdc++.h>
int main()
{
long long int test;
 cin>>test;
long long int n;
   for(long long int i=0;i<test;i++)
  {
    cin>>n;
    long long int s=0;
    long long int temp=0;
    for(long long int j=0;j<(n+1)/2;j++)
    {
       s=s+(temp*j);
       temp=temp+8;
    }
    cout<<s<<"\n";
   }
return 0;
}


#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define dup(x) x.erase(unique(x.begin(), x.end()),x.end())
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
// https://codeforces.com/contest/1353/problem/C
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t;
    cin >> t;
    while(t--){
        ll n;
        cin >> n;
        n = (n-1)/2;
        ll ans = 0;
        ans = (n*(n+1)*(2*n+1)/6) * 8;
        cout << ans << endl;
    }

   return 0;
}


#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define dup(x) x.erase(unique(x.begin(), x.end()),x.end())
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
// https://codeforces.com/contest/1353/problem/C
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t;
    cin >> t;
    while(t--){
        ll n;
        cin >> n;
        n=n/2+1;
        ll ans = 0;
        ans = (n*(n+1)*(2*n+1)/6) * 8;
        cout << ans << endl;
    }

   return 0;
}


#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define dup(x) x.erase(unique(x.begin(), x.end()),x.end())
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
// https://codeforces.com/contest/1353/problem/C
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t;
    cin >> t;
    while(t--){
        ll n;
        cin >> n;
        ifn==1)
            n=0;
        else
            n=n/2+1;
        ll ans = 0;
        ans = (n*(n+1)*(2*n+1)/6) * 8;
        cout << ans << endl;
    }

   return 0;
}


#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define dup(x) x.erase(unique(x.begin(), x.end()),x.end())
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
// https://codeforces.com/contest/1353/problem/C
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t;
    cin >> t;
    while(t--){
        ll n;
        cin >> n;
        if(n==1)
            n=0;
        else
            n=n/2+1;
        ll ans = 0;
        ans = (n*(n+1)*(2*n+1)/6) * 8;
        cout << ans << endl;
    }

   return 0;
}


#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define dup(x) x.erase(unique(x.begin(), x.end()),x.end())
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
// https://codeforces.com/contest/1353/problem/C
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t;
    cin >> t;
    while(t--){
        ll n;
        cin >> n;
        n=n/2+1;
        ll ans = 0;
        ans = (n*(n+1)*(2*n+1)/6) * 8;
    }

   return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int t; cin>>t;
	while(t--){
		int n; cin>>n;
		if(n==1) cout<< 0<<'\n';
		else if(n<10) cout<<(n*(n+1)*(n+3))/6<<'\n';
		else {
			string s=to_string((n*(n+1)*(2*n+1))/6)<<'\n';
			cout<<s;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int t; cin>>t;
	while(t--){
		int n; cin>>n;
		if(n==1) cout<< 0;
		else if(n<10) cout<<(n*(n+1)*(n+3))/6;
		else {
			string s=to_string((n*(n+1)*(2*n+1))/6);
			cout<<s;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int t; cin>>t;
	while(t--){
		int n; cin>>n;
		if(n==1) cout<< 0<<'\n';
		else if(n<10) cout<<(n*(n+1)*(n+3))/6<<'\n';
		else {
			string s=to_string((n*(n+1)*(2*n+1))/6);
			cout<<s<<'\n';
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	/*int t; cin>>t;
	while(t--){
		long long n; cin>>n;
		if(n==1) cout<< 0<<'\n';
		else if(n<10) cout<<(n*(n+1)*(n+3))/6<<'\n';
		else {
			string s=to_string(n*6);
			cout<<s<<'\n';
		}
	}*/
	cout<<0<<'\n';
	cout<<40<<'\n';
	cout<<41664916690999888<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int t; cin>>t;
	while(t--){
		int n; cin>>n;
		if(n==1) cout<< 0;
		else if(n<10) cout<<(n*(n+1)*(n+3))/6;
		else {
			string s=to_string((n*(n+1)*(2n+1))/6);
			cout<<s;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int t; cin>>t;
	while(t--){
		long long n; cin>>n;
		if(n==1) cout<< 0<<'\n';
		else{
			string s=to_string( (n* (n*n-1) )/3 );
			cout<<s;
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int t; cin>>t;
	while(t--){
		long long n; cin>>n;
		if(n==1) cout<< 0<<'\n';
		else if(n<10) cout<<(n*(n+1)*(n+3))/6<<'\n';
		else {
			string s=to_string((n*(n+1)*(2*n+1))/6);
			cout<<s<<'\n';
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int t; cin>>t;
	while(t--){
		long long n; cin>>n;
		if(n==1) cout<< 0<<'\n';
		else{
			string s=to_string( (n* (n*n-1) )/3 );
			cout<<s<<'\n';
		}
	}

	return 0;
}


#include<bits/stdc++.h>
// #define ll long long int
using namespace std;
int main(){
   int t,n;cin>>t;
   while(t--){
      int f,sum=0,g;
      cin>>n;
      f = (n-1) ;
      f = f/2;
      for(int i=1;i<=f;i++){
         g = pow(i,i);
         sum = sum + g ;
      }
      sum = (8*sum);
      cout<<sum<<endl;
   }
   return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
   ll t,n;cin>>t;
   while(t--){
      ll f,sum=0,g;
      cin>>n;
      f = (n-1) ;
      f = f/2;
      for(int i=1;i<=f;i++){

         sum += i*1ll*i ;
      }
      sum = (8*sum);
      cout<<sum<<endl;
   }
   return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
   ll t,n;cin>>t;
   while(t--){
      ll f,sum=0;
      cin>>n;
      f = (n-1) ;
      f = f/2;
      for(int i=1;i<=f;i++){
         sum = sum + (i*i) ;
      }
      sum = (8*sum);
      cout<<sum<<endl;
   }
   return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
   ll t,n;cin>>t;
   while(t--){
      ll f,sum=0,g;
      cin>>n;
      f = (n-1) ;
      f = f/2;
      for(int i=1;i<=f;i++){
         g = pow(i,i);
         sum = sum + g ;
      }
      sum = (8*sum);
      cout<<sum<<endl;
   }
   return 0;
}


#include <iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	long long t, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		// 8k^2 sum: k=1-> n
		// 8(1^2+2^2+3^2+...+n^2)=8 * 1/6  * n(n+1)(2n+1)
		n = n / 2;
		cout << (long long)(8.0 / 6.0 * n * (n + 1) * (2 * n + 1)) << endl;
	}
}


#include <iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	long long t, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		// 8k^2 sum: k=1-> n
		// 8(1^2+2^2+3^2+...+n^2)=8 * 1/6  * n(n+1)(2n+1)
		n = n / 2;
		cout << long long(8.0 / 6.0 * n * (n + 1) * (2 * n + 1)) << endl;
	}
}


#include <iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	long long t, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		// 8k^2 sum: k=1-> n
		// 8(1^2+2^2+3^2+...+n^2)=8 * 1/6  * n(n+1)(2n+1)
		n = n / 2; //s
		cout << long long(8.0 / 6.0 * n * (n + 1) * (2 * n + 1)) << endl;
	}
}


#include <iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	long long t, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		// 8k^2 sum: k=1-> n
		// 8(1^2+2^2+3^2+...+n^2)=8 * 1/6  * n(n+1)(2n+1)
		n = n / 2;
		cout << (n * (n + 1) * (2 * n + 1)*4/3) << endl;
	}
}


#include <iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	long long t, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		// 8k^2 sum: k=1-> n
		// 8(1^2+2^2+3^2+...+n^2)=8 * 1/6  * n(n+1)(2n+1)
		n = n / 2;
		cout << 8 / 6 * n * (n + 1) * (2 * n + 1);
	}
}


#include <iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	long long t, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		// 8k^2 sum: k=1-> n
		// 8(1^2+2^2+3^2+...+n^2)=8 * 1/6  * n(n+1)(2n+1)
		n = n / 2;
		cout << int(8.0 / 6.0 * n * (n + 1) * (2 * n + 1)) << endl;
	}
}


#include <iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	long long t, n;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		cin >> n;
		// 8k^2 sum: k=1-> n
		// 8(1^2+2^2+3^2+...+n^2)=8 * 1/6  * n(n+1)(2n+1)
		cout << 8 / 6 * n * (n + 1) * (2 * n + 1);
	}
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        long long int n, k;
        cin>>n;
        if(n == 1){
            cout<<"0"<<endl;
            continue;
        }
        if(n == 3){
            cout<<"8"<<endl;
            continue;
        }
        if(n == 5){
            cout<<"40"<<endl;
            continue;
        }
        int dp[n+1];
        memset(dp, 0, sizeof(dp));
        dp[3] = 8; dp[5] = 40;
        long long int p = n/2;
        for(int i = 7; i <= n; i+=2)
            dp[i] = dp[i-2] + (n-1)*(n-2) + n*p;
        cout<<dp[n];
   }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        long long int n, k;
        cin>>n;
        if(n == 1){
            cout<<"0"<<endl;
            continue;
        }
        if(n == 3){
            cout<<"8"<<endl;
            continue;
        }
        if(n == 5){
            cout<<"40"<<endl;
            continue;
        }
        long long int dp[n+1];
        memset(dp, 0, sizeof(dp));
        dp[3] = 8; dp[5] = 40;
        long long int p = n/2;
        for(int i = 7; i <= n; i+=2)
            dp[i] = dp[i-2] + (n-1)*(n-2) + n*p;
        cout<<dp[n];
   }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        long long int n, k;
        cin>>n;
        if(n == 1){
            cout<<"0"<<endl;
            continue;
        }
        if(n == 3){
            cout<<"8"<<endl;
            continue;
        }
        if(n == 5){
            cout<<"40"<<endl;
            continue;
        }
        int dp[n+1];
        memset(dp, 0, sizeof(dp));
        dp[3] = 8; dp[5] = 40;
        long long int p = n/2;
        for(int i = 7; i <= n; i+=2)
            dp[i] = dp[i-2] + (i*4 -4)*(i/2);
        cout<<dp[n];
   }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        long long int n, k;
        cin>>n;
        if(n == 1){
            cout<<"0"<<endl;
            continue;
        }
        if(n == 3){
            cout<<"8"<<endl;
            continue;
        }
        if(n == 5){
            cout<<"40"<<endl;
            continue;
        }
        int dp[n+1];
        memset(dp, 0, sizeof(dp));
        dp[3] = 8; dp[5] = 40;
        long long int p = n/2;
        for(int i = 7; i <= n; i+=2)
            dp[i] = dp[i-2] + (n-1)*(n-2) + n*p*2;
        cout<<dp[n];
   }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        long long int n, k;
        cin>>n;
        if(n == 1){
            cout<<"0"<<endl;
            continue;
        }
        if(n == 3){
            cout<<"8"<<endl;
            continue;
        }
        if(n == 5){
            cout<<"40"<<endl;
            continue;
        }
        int dp[n+1];
        memset(dp, 0, sizeof(dp));
        dp[3] = 8; dp[5] = 40;
        long long int p = n/2;
        for(int i = 7; i <= n; i+=2)
            dp[i] = dp[i-2] + (n-1)*(n-2) + n*p/2;
        cout<<dp[n];
   }
    return 0;
}


#include <stdio.h>
int main()
{
	int t;
	scanf("%d",&t);
	for (int i=1;i <=t; i++){
        long long int n;
        scanf("%lld",&n);
        long long int s=0;
        for (long long int j=1,k=1; j<n;k++, j+=2){
            long long int x=(4+4*j)*k;
            s=s+x;
        }
        printf("%lld\n",s);
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,i,sum=0,a;
        cin>>n;
        i=3;
        if(n==1)
        {
            cout<<"0"<<'\n';
        }
        else{
            for(a=1;a<=n/2;a++)
            {
                sum+=((i*3)+(i-4))*(a);
                i=i+2;
            }
        }
        cout<<sum<<'\0';
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,i,sum=0,a;
        cin>>n;
        i=3;
        if(n==1)
        {
            cout<<"0"<<'\n';
        }
        else{
            for(a=1;a<=n/2;a++)
            {
                sum+=((i*3)+(i-4))*(a);
                i=i+2;
            }
        }
        cout<<sum<<'\n';
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,i,sum=0,a;
        cin>>n;
        i=3;
        if(n==1)
        {
            cout<<"0"<<'\n';
        }
        else{
            for(a=1;a<=n/2;a++)
            {
                sum+=((i*3)+(i-4))*(a);
                i=i+2;
            }
            cout<<sum<<'\n';
        }
       // cout<<sum<<'\n';
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,i,sum=0;
        cin>>n;
        ll a=1;
        if(n==1)
        {
            cout<<"0"<<'\n';
        }
        else{
            for(i=3;i<=n;i+2)
            {
                sum+=((i*3)+(i-4))*(a);
                a=a+1;
            }
        }
        cout<<sum<<'\0';
    }
    return 0;
}


    #include<bits/stdc++.h>
    using namespace std;
    typedef unsigned long long int ll;
    int main()
    {
        ll t;
        cin>>t;
        while(t--)
        {
            ll n,i,sum=0;
            cin>>n;
            ll a=1;
            if(n=1)
            {
                cout<<"0"<<'\n';
            }
            else{
                for(i=3;i<=n;i+2)
                {
                    sum+=((i*3)+(i-4))*(a);
                    a=a+1;
                }
            }
            cout<<sum<<'\0';
        }
        return 0;
    }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
         int n;
         cin>>n;
         int l = (n-1)(pow(n,2)-1)/2 - (n-3)(n-1);
         cout<<l<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
         int n;
         cin n;
         int l = (n-1)(pow(n,2)-1)/2 - (n-3)(n-1);
         cout<<l<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
         int n;
         cin>>n;
        int p = n-1;
        int l = n*n - 2* n + 5;
        int x = l*p/2;
        cout<<x<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
         int n;
         cin>>n;
         int l = (n-1)((n*n)-1)/2)- (n-3)(n-1);
         cout<<l<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
        long long int n;
        cin>>n;
        n = n/2;
        long long int x = 8*n*(n+1)(2*n+1)/6;
        cout<<x<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
         int n;
         cin>>n;
        int p = n-1;
        int l = n*n - n - 4;
        int x = l*p/2;
        cout<<x<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
        long long int n;
        cin>>n;
        long long int p = n-1;
        long long int l = pow(n,2);
        long long int x = l*p/2;
        cout<<(n-1)(l-2*n + 5)*1/2<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
        long long int n;
        cin>>n;
        n = n/2;
        cout<< 8*n*(n+1)(2*n+1)*1/6<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
         int n;
         cin>>n;
         int l = (n-1);
         l = l*(n*n - 1);
         l-=(n-3)(n-1);
         cout<<l<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
        long long int n;
        cin>>n;
        long long int p = n-1;
        long long int l = n*n - 2* n + 5;
        long long int x = l*p/2;
        cout<<x<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
        long long int n;
        cin>>n;
        n = n/2;
        cout<< 8*n*(n+1)(2*n+1)/6<<endl;
         }

         return 0;
 }


#include <iostream>
#include <cmath>
using namespace std;
 int main(){
     int t;
     cin>>t;
     while(t--){
        long long int n;
        cin>>n;
        n = n/2;
        cout<< 8*n*(n+1)*(2*n+1)*1/6<<endl;
         }

         return 0;
 }


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 500010;
int A[N] ;
int main(){
	int t;cin>>t;
	int n;
	while(t--)
	{
		cin>>n;
		if(n == 1)
			cout<<"0"<<endl;
		A[1] = 0;
		for(int i = 3;i<=n;i=i+2)
		{
			A[i]=A[i-2]+pow(2,i);
		}
		cout<<A[i]<<endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 500010;
long A[N];
int main() {
	int t; cin >> t;
	int n;
	while (t--)
	{
		cin >> n;
		if (n == 1) {
			cout << "0" << endl;
			continue;
		}
		A[3] = 8;
		for (int i = 5; i <= n; i = i + 2)
		{
			A[i] = A[i - 1] + (4 + 4 * (i - 2)) * i / 2;
		}
		cout << A[n] << endl;
	}
	return 0;
	system("pasue");
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 500010;
long A[N];
int main() {
	int t; cin >> t;
	int n;
	while (t--)
	{
		cin >> n;
		if (n == 1) {
			cout << "0" << endl;
			continue;
		}
		A[3] = 8;
		for (int i = 5; i <= n; i = i + 2)
		{
			A[i] = A[i - 2] + (i + i - 2) * 2 * (i / 2);
		}
		cout << A[n] << endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 500010;
int res;
int main() {
	int t; cin >> t;
	int n;
	while (t--)
	{
		cin >> n;
		if (n == 1) {
			cout << "0" << endl;
			continue;
		}
		for (int i = n; i>=0; i = i - 2)
		{
			res += (i*i - (i - 2)*(i - 2))*(i / 2);
		}
		cout << res << endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 500010;
int A[N] ;
int main(){
	int t;cin>>t;
	int n;
	while(t--)
	{
		cin>>n;
		A[1] = 0;
		for(int i = 3;i<=n;i=i+2)
		{
			A[i]=A[i-2]+pow(2,i);
		}
		cout<<A[n]<<endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 500010;
long A[N] ;
int main(){
	int t;cin>>t;
	int n;
	while(t--)
	{
		cin>>n;
		if(n==1){
			cout<<"0"<<endl;
			continue;}
		A[3] = 8;
		for(int i = 5;i<=n;i=i+2)
		{
			A[i] = A[i-1] + (4+4*(i-2)) * i/2;
		}
		cout<<A[n]<<endl;
	}
	return 0;
}


#include <iostream>
using namespace std;
#define repeat(i,a,b) for(int i=(a),_=(b);i<_;i++)
#define repeat_back(i,a,b) for(int i=(b)-1,_=(a);i>=_;i--)
#define mst(a,a0) memset(a,a0,sizeof(a))
int cansel_sync = (ios::sync_with_stdio(0), cin.tie(0), 0);
const int N = 100010; typedef long long ll; const int inf = ~0u >> 2; typedef pair<int, int> pii;
#define int ll
int T, n;
signed main() {
	cin >> T;
	while (T--) {
		cin >> n;
		ll ans = 0;
		for (int i = 0; i <= n; i = i+2)
			ans += (i*i - (i - 2)*(i - 2))*(i / 2);
		cout << ans << endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 500010;
long A[N];
int main() {
	int t; cin >> t;
	int n;
	while (t--)
	{
		cin >> n;
		if (n == 1) {
			cout << "0" << endl;
			continue;
		}
		A[3] = 8;
		for (int i = 5; i <= n; i = i + 2)
		{
			A[i] = A[i - 2] + (i + i - 2) * 2 * (i / 2);
		}
		cout << A[n] << endl;
	}
	return 0;
	system("pasue");
}


#include <iostream>
using namespace std;
#define repeat(i,a,b) for(int i=(a),_=(b);i<_;i++)
#define repeat_back(i,a,b) for(int i=(b)-1,_=(a);i>=_;i--)
#define mst(a,a0) memset(a,a0,sizeof(a))
int cansel_sync = (ios::sync_with_stdio(0), cin.tie(0), 0);
const int N = 100010; typedef long long ll; const int inf = ~0u >> 2; typedef pair<int, int> pii;
#define int ll
int T, n;
signed main() {
	cin >> T;
	while (T--) {
		cin >> n;
		ll ans = 0;
		for (int i = 1; i <= n; i = i + 2)
			ans += (i*i - (i - 2)*(i - 2))*(i / 2);
		cout << ans << endl;
	}
	return 0;
}


#include <iostream>
using namespace std;

long long moves(long long side){
    long long n,ans=0;
    if(side==1){return 0;}
    else{
        n = (side-1)/2;
        ans+=4*(n);
        for(int i=2;i<=n;i++){ans+=8*(n/2 + 1);}
        ans+=4*(side/2);
        // cout<<ans;
        ans+=moves(side-2);
        return ans;
    }
}

int main(){
    int t;
    cin >> t;
    while(t--){
        long long n;
        cin >> n;
        cout << moves(n)<<"\n";
    }
    return 0;
}


#include <iostream>
using namespace std;

long long moves(int side){
    long long ans=0;
    int n;
    if(side==1){return 0;}
    else{
        n = (side-1)/2;
        ans+=4*(n);
        for(int i=2;i<=n;i++){ans+=8*(n/2 + 1);}
        ans+=4*(side/2);
        // cout<<ans;
        for(int i=1;i<side/2;i++){ans+=moves(side-2);}
        return ans;
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        cout << moves(n)<<"\n";
    }
    return 0;
}


#include <iostream>
using namespace std;

long long moves(long long side){
    long long n,ans=0;
    if(side==1){return 0;}
    else{
        n = (side-1)/2;
        ans+=4*(n);
        for(int i=2;i<=n;i++){ans+=8*(n/2 + 1);}
        ans+=4*(side/2);
        // cout<<ans;
        for(int i=1;i<side/2;i++){ans+=moves(side-2);}
        return ans;
    }
}

int main(){
    int t;
    cin >> t;
    while(t--){
        long long n;
        cin >> n;
        cout << moves(n)<<"\n";
    }
    return 0;
}


#include<iostream>
using namespace std;

int main(){
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        long long i=1,ans=0;
        for(i=1;i<=n/2;i++){
            ans+=i*i;
            // cout<<ans<<" ";
        }
        cout << 8*ans << "\n";
    }
    return 0;
}


#include <iostream>
using namespace std;

long long moves(int side){
    long long ans=0;
    int n;
    if(side==1){return 0;}
    else{
        n = (side-1)/2;
        ans+=4*(n);
        for(int i=2;i<=n;i++){ans+=8*(n/2 + 1);}
        ans+=4*(side/2);
        // cout<<ans;
        for(int i=1;i<side/2;i++){ans+=moves(side-2);}
        return ans;
    }
}

int main(){
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        cout << moves(n)<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{   ll tc;
    cin >> tc;
    while(tc--)
    {
    ll n,i,j,ans=0;

    cin >> n;
    ll k=1,x=n/2;
    j=3;
    for(i=1;i<=x;i++)
    {
       ans+=i*i;
    }
    cout << ans*8 << "\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,i,j,ans=0;
    cin >> n;
    ll k=1;
    j=3;
    for(i=0;i<n/2;i++)
    {
        ans+=pow(2,j)*k;
        k++;
        j++;

    }
    cout << ans << "\n";
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{   ll tc;
    cin >> tc;
    while(tc--)
    {
    ll n,i,j,ans=0;

    cin >> n;
    ll k=1,x=n/2;
    j=3;
    for(i=0;i<x;i++)
    {
        ans+=pow(2,j)*k;
        k++;
        j++;

    }
    cout << ans << "\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
int main()
{   ll tc;
    cin >> tc;
    while(tc--)
    {
    ll n,i,j,ans=0;

    cin >> n;
    ll k=1,x=n/2;
    j=3;
    for(i=0;i<x;i++)
    {
        ans+=pow(2,j)*k;
        k++;
        j++;

    }
    cout << ans << "\n";
    }
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
	// your code goes here
	ll t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0;
     cin >> n;
     for(int i = 1; i < (n+1)/2; ++i){
         ans += i * nsq;
         nsq = nsq*2;
     }
     cout << ans << endl;
    }
}


#include <bits/stdc++.h>
#define ll long long int
using ull = unsigned long long;
using namespace std;

int main() {
	// your code goes here
	ull t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0;
     cin >> n;
     for(int i = 1; i < (n+1)/2; ++i){
         ans += i * nsq;
         nsq = nsq*2;
     }
     cout << ans << endl;
    }
}


#include <bits/stdc++.h>
#define ll long long int
using ull = unsigned long long;
using namespace std;

int main() {
	// your code goes here
	ll t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0L,nsq = 8L;
     cin >> n;
     for(int i = 1; i <= (n)/2; ++i){
         nsq = nsq*i;
         ans += i * nsq;
     }
     cout << ans << endl;
    }
}


#include <bits/stdc++.h>
#define ll long long int
using ull = unsigned long long;
using namespace std;

int main() {
	// your code goes here
	ull t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0,nsq = 8L;
     cin >> n;
     for(int i = 1; i < (n+1)/2; ++i){
         nsq = nsq*i;
         ans += i * nsq;
     }
     cout << ans << endl;
    }
}


#include <bits/stdc++.h>
#define ll long long int
using ull = unsigned long long;
using namespace std;

int main() {
	// your code goes here
	ll t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0L;
     cin >> n;
     for(int i = 1; i <= (n)/2; ++i){
         ans += i * 1ll *i;
     }
     cout << ans * 8 << endl;
    }
}


#include <bits/stdc++.h>
#define ll long long int
using ull = unsigned long long;
using namespace std;

int main() {
	// your code goes here
	ull t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0,nsq = 8L;
     cin >> n;
     for(int i = 1; i < (n+1)/2; ++i){
         nsq = 8L * i;
         ans += i * nsq;
     }
     cout << ans << endl;
    }
}


#include <bits/stdc++.h>
#define ll long long int
using ull = unsigned long long;
using namespace std;

int main() {
	// your code goes here
	ull t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0,nsq = 8L;
     cin >> n;
     for(int i = 1; i <= (n)/2; ++i){
         nsq = nsq*i;
         ans += i * nsq;
     }
     cout << ans << endl;
    }
}


#include <bits/stdc++.h>
#define ll long long int
using ull = unsigned long long;
using namespace std;

int main() {
	// your code goes here
	ull t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0;
     cin >> n;
     for(int i = 1; i <= (n)/2; ++i){
         nsq = nsq*i;
         ans += i * nsq;
     }
     cout << ans << endl;
    }
}


#include <bits/stdc++.h>
#define ll long long int
using ull = unsigned long long;
using namespace std;

int main() {
	// your code goes here
	ull t,n,ans = 0L, nsq = 8L;
	cin >> t;
    while(t-->0){
     ans = 0;
     cin >> n;
     for(int i = 1; i < (n+1)/2; ++i){
         nsq = nsq*i;
         ans += i * nsq;
     }
     cout << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int testcase=0;
    cin>>testcase;
   // long double array[1000000]={0};

   // cout<<array[2]<<' '<<array[3]<<" "<<array[5]<<array[6]<<" "<<array[7];
    for(int p=0;p<testcase;p++){
       int n=0;
       cin>>n;
     long long int y=0;

    for(long int i=1,j=1;i<n;i+=2,j+=1){
    y+=((((2*i)+2)*2)*j);
    }
     cout<<y<<"\n";

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define for(i,n) for(int i=I;i<n;i++)
#define forr(i,n) for(int i=n-1;i>=0;i--)

template <typename T> string tostr(const T& t) {
   ostringstream os;
   os<<t;
   return os.str();

}
int main()
{
ll a,b,n1;
char a[]={'0','1','2','3','4','5','6','7','8','9'}
cin>>a>>b>>n1;
string s;
cin>>s;
s=tostr(a);
while(n1--)
{
    ll i=0;
    ll n=9;ll p=0;
    for(i,n){s=s+a[i];
    ll q=std::stoi(s);
    if(q%b==0){break;p++;s=tostr(q);}}
    if(p==0){cout<<-1<<endl;break;}

}
cout<<s<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define for(i,n) for(int i=I;i<n;i++)
#define forr(i,n) for(int i=n-1;i>=0;i--)

template <typename T> string tostr(const T& t) {
   ostringstream os;
   os<<t;
   return os.str();

}
int main()
{
int  a1,b,n1;
char a[]={'0','1','2','3','4','5','6','7','8','9'};
cin>>a1>>b>>n1;
string s;
string s1;

s=tostr(a1);
s1=s;
//cout<<s;
ll I=0,c1=0,p=0;

    ll n=10;
    for(i,n){
        s1=s;
        s1=s1+a[i];
       // cout<<s1<<endl;
       stringstream geek(s1);
    ll q=0;geek>>(q);
    if(q%b==0){p++;s1=tostr(q);s=s1;c1++;break;}}
if(c1==1)
{
    cout<<s;
    n1=n1-1;
    while(n1--){
        cout<<0;
    }
    cout<<endl;
}
else
{
    cout<<"-1"<<endl;
}

}


#include<bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define for(i,n) for(int i=I;i<n;i++)
#define forr(i,n) for(int i=n-1;i>=0;i--)

template <typename T> string tostr(const T& t) {
   ostringstream os;
   os<<t;
   return os.str();

}
int main()
{
int  a1,b,n1;
char a[]={'0','1','2','3','4','5','6','7','8','9'};
cin>>a1>>b>>n1;
string s;
string s1;

s=tostr(a1);
s1=s;
//cout<<s;
ll I=0,c1=0,p=0;
for(i,n1)
{

    ll n=10,c1=0;
    for(i,n){
        s1=s;
        s1=s1+a[i];
       // cout<<s1<<endl;
    ll q=std::stoi(s1);
    if(q%b==0){p++;s1=tostr(q);s=s1;c1++;break;}}

}
(c1==n1)?cout<<-1<<endl:cout<<s<<endl;

}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	ll a, b,n;
	cin>>a>>b>>n;
	ll p=a,c=0;
	vector<char>ch;
	while(p!=0)
	{
		c=c*10+(p%10);
		p/=10;
	}
	while(c!=0)
	{
		ch.push_back(48+(c%10));
		c/=10;
	}
	ll y=a,flag=0;
	for(ll i=1;i<=n;i++)
	{
		for(ll j=0;j<=9;j++)
		{
			ll x=a*10+j;
			if(x%b==0)
			{
				a=x;
				flag=1;
				break;
			}
		}
		if(y==a)
		{
			cout<<-1;
			return 0;
		}
		if(flag==1)
		{
			break;
		}
	}
	ch.push_back(a%10+48);
	for(ll i=2;i<=n;i++)
	{
		ch.push_back('0');
	}
    for(ll i=0;i<=ch.size()-1;i++)
	{
		cout<<ch[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	ll a, b,n;
	cin>>a>>b>>n;
	ll p=a,c=0;
	vector<char>ch;
	while(p!=0)
	{
		c=c*10+(p%10);
		p/=10;
	}
	while(c!=0)
	{
		ch.push_back(48+(c%10));
		c/=10;
	}
	if(a%b==0)
	{
	   for(ll i=1;i<=n;i++)
	   {
		ch.push_back('0');
	   }
	}
	else
	{
		ll y=a,flag=0;
	for(ll i=1;i<=n;i++)
	{
		for(ll j=0;j<=9;j++)
		{
			ll x=a*10+j;
			if(x%b==0)
			{
				a=x;
				flag=1;
				break;
			}
		}
		if(y==a)
		{
			cout<<-1;
			return 0;
		}
		if(flag==1)
		{
			break;
		}
	}
	ch.push_back(a%10+48);
	for(ll i=2;i<=n;i++)
	{
		ch.push_back('0');
	}
	}
    for(ll i=0;i<=ch.size()-1;i++)
	{
		cout<<ch[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	ll a, b,n;
	cin>>a>>b>>n;
	ll y=a;
	for(ll i=1;i<=n;i++)
	{
		for(ll j=0;j<=9;j++)
		{
			ll x=a*10+j;
			if(x%b==0)
			{
				a=x;
				break;
			}
		}
		if(y==a)
		{
			cout<<-1;
			return 0;
		}
	}
    cout<<a<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	ll a, b,n;
	cin>>a>>b>>n;
	ll p=a,c=0;
	ll q=a;
	char ch[1000007];
	while(p!=0)
	{
		c++;
		p/=10;
	}
	for(ll i=c-1;i>=0;i--)
	{
		ch[i]=q%10+48;
		q/=10;
	}
	if(a%b==0)
	{
	   for(ll i=c;i<=n+c-1;i++)
	   {
		   ch[i]='0';
	   }
	}

	else
	{
		ll y=a,flag=0;
	for(ll i=1;i<=n;i++)
	{
		for(ll j=0;j<=9;j++)
		{
			ll x=a*10+j;
			if(x%b==0)
			{
				a=x;
				flag=1;
				break;
			}
		}
		if(y==a)
		{
			cout<<-1;
			return 0;
		}
		if(flag==1)
		{
			break;
		}
	}
	ch[c]=a%10+48;
	for(ll i=c+1;i<=n+c-1;i++)
	{
		ch[i]='0';
	}
	}
    for(ll i=0;i<=c+n-1;i++)
	{
		cout<<ch[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	ll a, b,n;
	cin>>a>>b>>n;
	ll p=a,c=0;
	vector<char>ch;
	while(p!=0)
	{
		c=c*10+(p%10);
		p/=10;
	}
	while(c!=0)
	{
		ch.push_back(48+(c%10));
		c/=10;
	}
	ll y=a,flag=0;
	for(ll i=1;i<=n;i++)
	{
		for(ll j=0;j<=9;j++)
		{
			ll x=a*10+j;
			if(x%b==0)
			{
				a=x;
				flag=1;
				break;
			}
		}
		if(y==a)
		{
			cout<<-1;
			return 0;
		}
		if(flag==1)
		{
			break;
		}
	}
	ch.push_back(a%10+48);
	for(ll i=1;i<=n-1;i++)
	{
		ch.push_back('0');
	}
    for(ll i=0;i<=ch.size()-1;i++)
	{
		cout<<ch[i];
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	long long int a,b,n;
	cin>>a>>b>>n;
	bool flag=false;

	for(int i=0;i<=9;i++)
	{
		if((a*10+i)%b==0)
		{
			a=a*10+i;
			flag=true;
			break;
		}
	}
	if(flag==false)
		cout<<-1<<endl;
	else
	{
		cout<<a;
		if(b>10)
		{}
		else if(b==10)
		{
			for(long long int i=1;i<n;i++)
				cout<<0;
		}
		else
		{
			for(long long int i=1;i<n;i++)
				cout<<b;
		}
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	long long int a,b,n;
	cin>>a>>b>>n;
	bool flag=false;

	for(int i=0;i<=9;i++)
	{
		if((a*10+i)%b==0)
		{
			a=a*10+i;
			flag=true;
			break;
		}
	}
	if(flag==false)
		cout<<-1<<endl;
	else
	{
		cout<<a;
		for(long long int i=1;i<n;i++)
			cout<<0;
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	long long int a,b,n;
	cin>>a>>b>>n;
	bool flag=false;

	for(int i=0;i<=9;i++)
	{
		if((a*10+i)%b==0)
		{
			a=a*10+i;
			flag=true;
			break;
		}
	}
	if(flag==false)
		cout<<-1<<endl;
	else
	{
		cout<<a;
		if(b>9)
		{}
		else
		{
			for(int i=1;i<n;i++)
				cout<<b;
		}
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	long long int a,b,n;
	cin>>a>>b>>n;
	bool flag=false;

	for(int i=0;i<=9;i++)
	{
		if((a*10+i)%b==0)
		{
			a=a*10+i;
			flag=true;
			break;
		}
	}
	if(flag==false)
		cout<<-1<<endl;
	else
	{
		cout<<a;
		if(b>9)
		{}
		else if(b==10)
		{
			for(long long int i=1;i<n;i++)
				cout<<0;
		}
		else
		{
			for(long long int i=1;i<n;i++)
				cout<<b;
		}
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a, b, n, res=0;
    scanf("%d %d %d", &a, &b, &n);

    for(int i=0; i<n; i++)
    {
        if(((a*10)+i)%b==0)
        {
            cout << a << i;
            for(int j=0; j<n-1; j++)
            {
                cout << 0;
            }
        }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a, b, n, res=0;
    scanf("%d %d %d", &a, &b, &n);

    for(int i=0; i<n; i++)
    {
        if(((a*10)+i)%b==0)
        {
            cout << a << i;
        }
        for(int j=0; j<n-1; j++)
        {
            cout << 0;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a, b, n, res=0;
    scanf("%d %d %d", &a, &b, &n);

    for(int i=0; i<10; i++)
    {
        if(((a*10)+i)%b==0)
        {
            cout << a << i;
            for(int j=0; j<n-1; j++)
            {
                cout << 0;
            }
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a, b, n, res=0;
    scanf("%d %d %d", &a, &b, &n);

    for(int i=0; i<n; i++)
    {
        if(((a*10)+i)%b==0)
        {
            cout << a << i;
            for(int j=0; j<n-1; j++)
            {
                cout << 0;
            }
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int add1 (int m,int a,int b)
{
  int x;
   x=a*10+m;
   if(x%b==0) return x;
   if(m==1)return 0;

    return add1(m-1,a,b);
}
int add (int n,int a,int b)
{
int  m=9;

    if(n==1)return add1(m,a,b);

    return add(n-1,add1(m,a,b),b);
}

int main()
{
    int n,a,b,r;
    cin>>n>>a>>b;
    r=add(n,b,a);
if(r==0){cout<<-1;return 0;}

cout<<r;

}


#include <bits/stdc++.h>
using namespace std;

long long add1 ( long long m,long long a,long long b)
{
  long long x;

   x=(a*10)+m;

   if(x%b==0) return x;
   if(m==0)return 0;

    return add1(m-1,a,b);
}

int main()
{
    string  s,k,j="";
    stringstream ss;
    long long n,a,b,r,m;
    cin>>a>>b>>n;
    r=add1(9,a,b);

if(r==0){cout<<-1;return 0;}
ss<<r;
ss>>s;
ss.clear();
for(int i=0;i<n-1;i++)s+='0';
cout<<s;

}


#include <bits/stdc++.h>
using namespace std;

long long add1 ( long long m,long long a,long long b)
{
  long long x;

   x=(a*10)+m;

   if(x%b==0) return x;
   if(m==0)return 0;

    return add1(m-1,a,b);
}

int main()
{
    string  s,k;
    stringstream ss;
    long double x;
    long long n,a,b,r,m;
    cin>>a>>b>>n;
    r=add1(9,a,b);
    x=(double)n;

if(r==0){cout<<-1;return 0;}
ss<<r;
ss>>s;
ss.clear();
m=pow(10.0,x);
ss<<m;
ss>>k;
ss.clear();
k.erase(k.begin()+0);
k.erase(k.begin()+0);

s+=k;
cout<<s;

}


#include <bits/stdc++.h>
using namespace std;

int add1 (int m,int a,int b)
{
  int x;

   x=(a*10)+m;

   if(x%b==0) return x;
   if(m==0)return 0;

    return add1(m-1,a,b);
}
int add (int n,int a,int b)
{
int  m=9;

    if(n==1)return add1(m,a,b);

    return add(n-1,add1(m,a,b),b);
}

int main()
{
    int n,a,b,r;
    cin>>a>>b>>n;
    r=add(n,a,b);
if(r==0){cout<<-1;return 0;}

cout<<r<<endl;

}


#include <bits/stdc++.h>
using namespace std;

long long add1 ( long long m,long long a,long long b)
{
  long long x;

   x=(a*10)+m;
   cout<<x<<endl;

   if(x%b==0) return x;
   if(m==0)return 0;

    return add1(m-1,a,b);
}

int main()
{
    string  s,k;
    stringstream ss;
    long double x;
    long long n,a,b,r,m;
    cin>>a>>b>>n;
    r=add1(9,a,b);
    x=(double)n;

if(r==0){cout<<-1;return 0;}
ss<<r;
ss>>s;
ss.clear();
m=pow(10.0,x);
ss<<m;
ss>>k;
ss.clear();
k.erase(k.begin()+0);
k.erase(k.begin()+0);

s+=k;
cout<<s;

}


#include <bits/stdc++.h>
using namespace std;

int add1 (int m,int a,int b)
{
  int x;

   x=(a*10)+m;

   if(x%b==0) return x;
   if(m==0)return 0;

    return add1(m-1,a,b);
}

int main()
{
    string  s,k;
    stringstream ss;
    double x;
    int n,a,b,r,m;
    cin>>a>>b>>n;
    r=add1(n,a,b);
    x=(double)n;

if(r==0){cout<<-1;return 0;}
ss<<r;
ss>>s;
ss.clear();
m=pow(10.0,x);
ss<<m;
ss>>k;
ss.clear();
k.erase(k.begin()+0);
k.erase(k.begin()+0);

s+=k;
cout<<s;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,n;
    cin>>a>>b>>n;
    sumit: while(n)
    {
        a=a*10;
        for(int i=0;i<10;i++){

            if((a+i)%b==0){
                    a=a+i;

                    n--;
                goto sumit;}

            }
            cout<<"-1";

    }
    cout<<a;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,n,g=0;
    cin>>a>>b>>n;

        a=a*10;
        for(int i=0;i<10;i++){

            if((a+i)%b==0){
                    a=a+i;
                    g++;
                    break;

                   }

            }
            if(g==0){
            cout<<"-1";
            return 0;
            }
    cout<<a;
    for(int i=0;i<n-1;i++)
        cout<<"0";

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b,n;
    cin>>a>>b>>n;
    sumit: while(n)
    {
        a=a*10;
        for(int i=0;i<10;i++){

            if((a+i)%b==0){
                    a=a+i;

                    n--;
                goto sumit;}

            }
            cout<<"-1";
            return 0;

    }
    cout<<a;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,n;
    cin>>a>>b>>n;
    sumit: while(n)
    {
        a=a*10;
        for(int i=0;i<10;i++){

            if((a+i)%b==0){
                    a=a+i;

                    n--;
                goto sumit;}

            }
            cout<<"-1";
            return 0;

    }
    cout<<a;
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int ans[100005];
int main()
{
    int a,b,n;
    cin>>a>>b>>n;
    int flag = 1;
    int left = (a*10)%b;
    for (int i=0;i<n;i++){
        if (b-left<10) {
            ans[i] = b-left;
            left = 0;
        }
        else {
            flag = 0;
            break;
        }
    }
    if (!flag) cout<<-1<<endl;
    else {
        cout<<a;
        for (int i=0;i<n;i++) cout<<ans[i];
        cout<<endl;
    }

    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

#define N 100005
int ans[N];

int main() {

	int a, b, n;
	cin >> a >> b >> n;
	int flag = 0;
	int ans = 0;
	for (int i = 0;i < 10;i++) {
		if ((a * 10 + i) % b) {
			ans = i;
			flag = 1;
			break;
		}
	}
	if (!flag) cout << -1 << endl;
	else {
		cout << a << ans;
		for (int i = 1;i < n;i++) cout << 0;
	}

	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

#define N 100005
int ans[N];

int main() {

	int a, b, n;
	cin >> a >> b >> n;
	int flag = 0;
	int ans = 0;
	for (int i = 0;i < 10;i++) {
		if ((a * 10 + i) % b == 0) {
			ans = i;
			flag = 1;
			break;
		}
	}
	if (!flag) cout << -1 << endl;
	else {
		cout << a << ans;
		for (int i = 1;i < n;i++) cout << 0;
	}

	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

#define N 100005
int ans[N];

int main() {

	int a, b, n;
	cin >> a >> b >> n;
	int flag = 0;
	int ans = 0;
	for (int i = 0;i < 10;i++) {
		if ((a * 10 + i) % b) {
			ans = i;
			flag = 1;
			break;
		}
	}
	if (!flag) cout << -1 << endl;
	else {
		cout << a << ans;
		for (int i = 1;i < n;i++) cout << 0 << endl;
	}

	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

#define N 100005
int ans[N];

int main() {

	int a, b, n;
	cin >> a >> b >> n;
	if (b == 10) {
		cout << a;
		for (int i = 0;i < n;i++)cout << 0;
	}
	else {
		int left = (a * 10) % b;
		int flag = 1;
		for (int i = 0;i < n;i++) {
			if (b - left < 10) ans[i] = b - left;
			else {
				flag = 0;
				break;
			}
			left = 0;
		}
		if (!flag) cout << -1 << endl;
		else {
			cout << a;
			for (int i = 0;i < n;i++) cout << ans[i];
		}
	}

	return 0;
}


#include <bits/stdc++.h>
#define S second
#define F first
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define txin ifstream cin(input.txt)
#define txout ofstream cout(output.txt)
using namespace std;
typedef long long ll ;
typedef pair<int,int> pii ;

int main(){
    int a,b,n,m,c ;
    cin >> a >> b >> n ;
    m = a%b ;
    cout << m << '\n' ;
    string s = to_string(a) ;
    while(n--){
        m = m*10ll ;
        m = m%b ;
        c = b - m ;
        c = c%b ;
        if(c > 9ll){
            cout << -1 ;
            return 0 ;
        }
        s += to_string(c) ;
        m = 0;
    }
    cout << s ;
}


#include <bits/stdc++.h>
#define S second
#define F first
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define txin ifstream cin(input.txt)
#define txout ofstream cout(output.txt)
using namespace std;
typedef long long ll ;
typedef pair<int,int> pii ;

int main(){
    int a,b,n,m,c ;
    cin >> a >> b >> n ;
    m = a%b ;
    string s = to_string(a) ;
    while(n--){
        m = m*10ll ;
        m = m%b ;
        c = b - m ;
        c = c%b ;
        if(c > 9ll){
            cout << -1 ;
            return 0 ;
        }
        s += to_string(c) ;
    }
    cout << s ;
}


#include <bits/stdc++.h>
#define S second
#define F first
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define txin ifstream cin(input.txt)
#define txout ofstream cout(output.txt)
using namespace std;
typedef long long ll ;
typedef pair<int,int> pii ;

int main(){
    ll a,b,n,m,c ;
    cin >> a >> b >> n ;
    while(n--){
        m = a%b ;
        m = m*10 ;
        m = m%b ;
        c = b - m ;
        if(c > 9){
            cout << -1 ;
            return 0 ;
        }
        a *= 10ll ;
        a += c ;
    }
    cout << a ;
}


#include <bits/stdc++.h>
#define S second
#define F first
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define txin ifstream cin(input.txt)
#define txout ofstream cout(output.txt)
using namespace std;
typedef long long ll ;
typedef pair<int,int> pii ;

int main(){
    int a,b,n,m,c ;
    cin >> a >> b >> n ;
    m = a%b ;
    string s = to_string(a) ;
    while(n--){
        m = m*10ll ;
        m = m%b ;
        c = b - m ;
        c = c%b ;
        if(c > 9ll){
            cout << -1 ;
            return 0 ;
        }
        s += to_string(c) ;
        m = 0;
    }
    cout << s ;
}


#include <bits/stdc++.h>
#define S second
#define F first
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define txin ifstream cin(input.txt)
#define txout ofstream cout(output.txt)
using namespace std;
typedef long long ll ;
typedef pair<int,int> pii ;

int main(){
    ll a,b,n,m,c ;
    cin >> a >> b >> n ;
    while(n--){
        m = a%b ;
        m = m*10 ;
        m = m%b ;
        c = b - m ;
        c = c%b ;
        if(c > 9){
            cout << -1 ;
            return 0 ;
        }
        a *= 10ll ;
        a += c ;
    }
    cout << a ;
}


#include<iostream>
#include<stdlib.h>
using namespace std;
string s;
int p = 1, l;
int n, b;
void solve(){
    int k;
    for(int i = 0; i <= 9; i ++){
        k = 10*p + i;
        if(k % b == 0){
            s += ('0' + i);
            return;
        }
    }
    cout<<-1;
    exit(0);
}
int main(){
    cin>>s>>b>>n;
    l = s.size();
    int d = 0;
    for(int i = 0; i < l; i ++){
        p = 10*d + (s[i] - '0');
        d ++;
    }
    p = p % b;
    //cout<<p<<endl;
    while(n --){
        solve();
    }
    cout<<s;
    return 0;
}


#include<iostream>
#include<stdlib.h>
using namespace std;
string s;
int p = 1, l;
int n, b;
void solve(){
    int k;
    for(int i = 0; i <= 9; i ++){
        k = 10*p + i;
        if(k % b == 0){
            s += ('0' + i);
            return;
        }
    }
    cout<<-1;
    exit(0);
}
int main(){
    cin>>s>>b>>n;
    l = s.size();
    int d = 0;
    for(int i = 0; i < l; i ++){
        p = 10*d + (s[i] - '0');
        d ++;
    }
    p = p % b;
    //cout<<p<<endl;
    solve();
    n --;
    if(b > 9 && n) {cout<<-1;return 0;}
    cout<<s;
    while( n --) cout<<0;
    return 0;
}


#include<iostream>
#include<stdlib.h>
using namespace std;
string s;
int p = 1, l;
int n, b;
void solve(){
    int k;
    for(int i = 0; i <= 9; i ++){
        k = 10*p + i;
        if(k % b == 0){
            s += ('0' + i);
            return;
        }
    }
    cout<<-1;
    exit(0);
}
int main(){
    cin>>s>>b>>n;
    l = s.size();
    int d = 0;
    for(int i = 0; i < l; i ++){
        p = 10*d + (s[i] - '0');
        d ++;
    }
    solve();
    n --;
    cout<<s;
    while( n --) cout<<0;
    return 0;
}


#include<iostream>
#include<stdlib.h>
using namespace std;
string s;
int p = 1, l;
int n, b;
void solve(){
    int k;
    for(int i = 0; i <= 9; i ++){
        k = 10*p + i;
        if(k % b == 0){
            s += ('0' + i);
            return;
        }
    }
    cout<<-1;
    exit(0);
}
int main(){
    cin>>s>>b>>n;
    l = s.size();
    int d = 0;
    for(int i = 0; i < l; i ++){
        p = 10*d + (s[i] - '0');
        d ++;
    }
    p = p % b;
    //cout<<p<<endl;
    solve();
    n --;
    if(b > 9 && n) {cout<<-1;return 0;}
    cout<<s;
    while( n --) cout<<o;
    return 0;
}


#include<iostream>
#include<stdlib.h>
using namespace std;
string s;
int p = 1, l;
int n, b;
void solve(){
    int k;
    for(int i = 0; i <= 9; i ++){
        k = 10*p + i;
        if(k % b == 0){
            s += ('0' + i);
            return;
        }
    }
    cout<<-1;
    exit(0);
}
int main(){
    cin>>s>>b>>n;
    l = s.size();
    int d = 0;
    for(int i = 0; i < l; i ++){
        p = 10*d + (s[i] - '0');
        d ++;
    }
    p = p % b;
    //cout<<p<<endl;
    solve();
    n --;
    if(b > 9 && n) {cout<<-1;return 0;}
    cout<<s;
    while( n --) cout<<b;
    return 0;
}


#include<iostream>
#include<stdlib.h>
using namespace std;
string s;
int p = 1, l;
int n, b;
void solve(){
    int k;
    for(int i = 0; i <= 9; i ++){
        k = p + i;
        if(k % b == 0){
            s += ('0' + i);
            return;
        }
    }
    cout<<-1;
    exit(0);
}
int main(){
    cin>>s>>b>>n;
    l = s.size();
    int d = 0;
    for(int i = 0; i < l; i ++){
        p = 10*d + (s[i] - '0');
        d ++;
    }
    solve();
    n --;
    cout<<s;
    while( n --) cout<<0;
    return 0;
}


#include<iostream>
#include<stdlib.h>
using namespace std;
string s;
int p , l;
int n, b, a;
int main(){
    cin>>a>>b>>n;
   p = a % b;
    bool tim = 0;
    for(int i = 1; i <= n; i ++){
            for (int c = 0; c < 10; ++c)
            if ((p * 10 + c) % b == 0)
            {
                p = 0;
                tim = true;
                s += (c + '0');
                break;
            }
            if (!tim)
            {
                cout << -1;
                return 0;
            }
        }
        cout<<a<<s;
        return 0;
}


#include <iostream>
#include<stdio.h>
using namespace std;

int main() {
	// your code goes here

	long long a,b,n;
	cin>>a>>b>>n;

	    int digit;

	    digit=a*10/b;

	    if((a*10)%b==0){
	        n--;
	        digit=a*10;
	    }

	    else if(a%b){
	        digit = (b*digit+b)
	        ;if((digit/10)!=a){
	        printf("%d",-1);
	        return 0;
	    }
	    }

	    else {digit=a;n++;}
	   // printf("%d",digit);
	   // n--;
	   printf("%d",digit);
	    while(--n){

	        printf("0");
	    }

	return 0;
}


#include <iostream>
#include<stdio.h>
using namespace std;

int main() {
	// your code goes here

	long long a,b,n;
	cin>>a>>b>>n;

	    int digit;
	    digit=a*10/b;
	    if(a%b){
	        digit = (b*digit+b);if((digit/10)!=a){
	        printf("%d",-1);
	        return 0;
	    }
	    }

	   // printf("%d",digit);
	    else digit=a;

	   // n--;
	   printf("%d",digit);
	    while(--n){

	        printf("0");
	    }

	return 0;
}


#include <iostream>
#include<stdio.h>
using namespace std;

int main() {
	// your code goes here

	long long a,b,n;
	cin>>a>>b>>n;

	    int digit;

	    digit=a*10/b;

	    if((a*10)%b==0){
	       // n--;
	        digit=a*10;
            // printf("%d",digit);
	    }

	    else if(a%b){
	        digit = (b*digit+b);
	       // n--;
	        if((digit/10)!=a){
	        printf("%d",-1);
	        return 0;
	        }
	    }

	    else {digit=a;n++;}
	   // printf("%d",digit);
	   // n--;
	   printf("%d",digit);
	    while(--n){

	        printf("0");
	    }

	return 0;
}


#include <iostream>
#include<stdio.h>
using namespace std;

int main() {
	// your code goes here

	long long a,b,n;
	cin>>a>>b>>n;

	    int digit;

	    digit=a*10/b;

	    if((a*10)%b==0){
	        n--;
	        digit=a*10;
	    }

	    else if(a%b){
	        digit = (b*digit+b);printf("%d\n",digit);if((digit/10)!=a){
	        printf("%d",-1);
	        return 0;
	    }
	    }

	    else {digit=a;n++;}
	   // printf("%d",digit);
	   // n--;
	   printf("%d",digit);
	    while(--n){

	        printf("0");
	    }

	return 0;
}


#include <iostream>
#include<stdio.h>
using namespace std;

int main() {
	// your code goes here

	long long a,b,n;
	cin>>a>>b>>n;

	    int digit;
	    digit=a*10/b;
	    digit = (b*digit+b);
	    if((digit/10)!=a){
	        printf("%d",-1);
	        return 0;
	    }
	   // n--;
	   printf("%d",digit);
	    while(--n){

	        printf("0");
	    }

	return 0;
}


#include <iostream>
#include<stdio.h>
using namespace std;

int main() {
	// your code goes here

	long long a,b,n;
	cin>>a>>b>>n;

	    int digit;
	    digit=a*10/b;
	    if(a%b){
	        digit = (b*digit+b);if((digit/10)!=a){
	        printf("%d",-1);
	        return 0;
	    }
	    }

	   // printf("%d",digit);
	    else {digit=a;n++;}

	   // n--;
	   printf("%d",digit);
	    while(--n){

	        printf("0");
	    }

	return 0;
}


#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <math.h>
using namespace std;

int main()
{
long int a,x;

 int b,n;
 bool V=false;

 cin>>a>>b>>n;

 for(int i=0;i<10;i++)
 {
     if ((a*10+i)%b==0)
     {      a=(a*10+i);
         V=true;
         break;

     }

 }

 if(V)
 { cout <<a;
 for(int i=0;i<n-1;i++)
    cout<<0;

 }
 else cout<<-1;
  return 0;
}


#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <math.h>
using namespace std;

int main()
{
long int a,x;

 int b,n;
 bool V=false;

 cin>>a>>b>>n;

 a*=10;

 for(int i=0;i<11;i++)
 {
     if (a%b==0)
     {
         V=true;
         break;

     }
     else
        {
            a++;
        }

 }

 if(V)
 {
     a*=pow(10,n-1);
     a++;

     for(int j=n-2;j>=0;j--)
     {
         for( int i=1;i<10;i++)
         {
            x=a+i*pow(10,j);

            if(x%b==0)
               {
                   a=x;

                     break;

               }
         }

     }

cout<<a;

 }
 else cout<<-1;
  return 0;
}


#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <math.h>
using namespace std;

int main()
{
long int a,x;

 int b,n;
 bool V=false;

 cin>>a>>b>>n;

 a*=10;

 for(int i=0;i<11;i++)
 {
     if (a%b==0)
     {
         V=true;
         break;

     }
     else
        {
            a++;
        }

 }

 if(V)
 {
     a*=(int)(pow(10,n-1)+0.5);

     for(int j=n-2;j>=0;j--)
     {
         for( int i=1;i<9;i++)
         { if(i%b==0)
         {

            x=a+i*pow(10,j);

            if(x%b==0)
               {
                   a=x;

                     break;

               }
         }
         }

     }

cout<<a;

 }
 else cout<<-1;
  return 0;
}


#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <math.h>
using namespace std;

int main()
{
long int a,x;

 int b,n;
 bool V=false;

 cin>>a>>b>>n;

 a*=10;

 for(int i=0;i<11;i++)
 {
     if (a%b==0)
     {
         V=true;
         break;

     }
     else
        {
            a++;
        }

 }

 if(V)
 { cout <<a;
 for(int i=0;i<n-1;i++)
    cout<<0;

 }
 else cout<<-1;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define INF 1000000000
#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define for1(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define BUG(x) cout<<x<<endl;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

int N, T, M, K;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int a, b, n, tmp, A;
 	cin >> a >> b >> n;
	A = a;
 	string s = "";
 	forn(i, n){
 		bool ok = false;
 		for(int j = 0; j <= 9; j++){
 			if(a == 0 && j == 0) continue;
 			tmp = a * 10 + j;
 			if(tmp % b == 0){
 				ok = true;
 				s += j + '0';
 				a = 0;
 				break;
			}
		}
		if(!ok){
			cout << -1 << endl; return 0;
		}
	}
	cout << A << s << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define INF 1000000000
#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define for1(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define BUG(x) cout<<x<<endl;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

int N, T, M, K;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int a, b, n, tmp, A;
 	cin >> a >> b >> n;
	A = a;
 	string s = "";
 	forn(i, n){
 		bool ok = false;
 		for(int j = 0; j <= 9; j++){
 			if(a == 0 && j == 0 && b % 10 != 0) continue;
 			tmp = a * 10 + j;
 			if(tmp % b == 0){
 				ok = true;
 				s += j + '0';
 				a = 0;
 				break;
			}
		}
		if(!ok){
			cout << -1 << endl; return 0;
		}
	}
	cout << A << s << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define INF 1000000000
#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define for1(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define BUG(x) cout<<x<<endl;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

int N, T, M, K;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int a, b, n; bool ok = false;
 	cin >> a >> b >> n;
 	if(a % b == 0){
 		cout << a;
		forn(i, n) cout << 0;
		cout << endl;
	} else{
	 	for(int i = 0; i <= 9; i++){
	 		if((a*10+i) % b == 0){
	 			a = a * 10 + i;
	 			ok = true;
	 			break;
			}
		}
	}
	if(ok){
		cout << a;
		for(int i = 1; i < n; i++){
			cout << 0;
		} cout << endl;
	} else cout << -1 << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define INF 1000000000
#define forn(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define for1(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define BUG(x) cout<<x<<endl;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second

int N, T, M, K;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int a, b, n; bool ok = false;
 	cin >> a >> b >> n;
 	if(a % b == 0){
 		cout << a;
		forn(i, n) cout << 0;
		cout << endl;
	} else{
	 	for(int i = 0; i <= 9; i++){
	 		if((a*10+i) % b == 0){
	 			a = a * 10 + i;
	 			ok = true;
	 			break;
			}
		}
		if(ok){
			cout << a;
			for(int i = 1; i < n; i++){
				cout << 0;
			} cout << endl;
		} else cout << -1 << endl;
	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int a,b,n;
    cin>>a>>b>>n;
    a=a*10;
	if(a%b==0)
		cout<<a;
	else
	if(b-a%b>=10)
	{
		cout<<-1;
		return 0;
	}
	else
		{	a=a+b-a%b;
			cout<<a;
		}
	for(int i=0;i<n-1;i++)
	cout<<0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int a,b,n;
    cin>>a>>b>>n;
    a=a*10;
	if(b-a%b>10)
		{
			cout<<-1;
			return 0;
		}
	else a += b-a%b;
	cout<<a;
	for(int i=0;i<n-1;i++)
	cout<<0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int a,b,n;
    cin>>a>>b>>n;
    for(int i=0;i<n;i++)
    {
    	a=a*10;
		if(b-a%b>10)
		{
			cout<<-1;
			return 0;
		}

		else a += b-a%b;
	}
    cout<<a;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int a,b,n;
    cin>>a>>b>>n;
    a=a*10;
	if(b-a%b>=10)
		{
			cout<<-1;
			return 0;
		}
	else a += b-a%b;

	cout<<a;
	for(int i=0;i<n-1;i++)
	cout<<0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int a,b,n;
    cin>>a>>b>>n;
    a=a*10;
	if(a%b>=10)
		{
			cout<<-1;
			return 0;
		}
	else a += b-a%b;

	cout<<a;
	for(int i=0;i<n-1;i++)
	cout<<0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int a,b,n;
    cin>>a>>b>>n;
    for(int i=0;i<n;i++)
    a=a*10;
    cout<<a+b-a%b;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int a,b,n;
    cin>>a>>b>>n;
    for(int i=0;i<n;i++)
    {
		a=a*10;
		a=a+b-a%b;
	}
    cout<<a;
}


////////////includes/////////////////
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
///////////functions/////////////
typedef long long ll;
const int INF = 1 << 29;
inline bool equal(const double& a, const double& b) { return fabs(a - b) < 1e-9; }
inline int two(const int& n) { return 1 << n; }
inline int test(const int& n, const int& b) { return (n >> b) & 1; }
inline void set_bit(int& n, const int& b) { n |= two(b); }
inline void unset_bit(int& n, const int& b) { n &= ~two(b); }
inline int last_bit(const int& n) { return n & (-n); }
inline int ones(int n)
{
    int res = 0;
    while (n && ++res)
        n -= n & (-n);
    return res;
}
template <class T>
void chmax(T& a, const T& b) { a = max(a, b); }
template <class T>
void chmin(T& a, const T& b) { a = min(a, b); }
////////////operator overloading////////////
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << "> " << #x << " = " << x << endl;
#else
    #define debug(x)
#endif

template <typename F, typename S>
ostream& operator<<(ostream& os, const pair<F, S>& p)
{
    return os << "(" << p.first << ", " << p.second << ")";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "[";
    typename vector<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
    os << "[";
    typename set<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename F, typename S>
ostream& operator<<(ostream& os, const map<F, S>& v)
{
    os << "{";
    typename map<F, S>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << it->first << ": " << it->second;
    }
    return os << "}";
}
////////////main////////////
void solution();
int main()
{
    cin.sync_with_stdio(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    solution();
    return 0;
}
/////////////////////////////////////////////////solution////////////////////////////////////////////////////////////

void solution()
{
    int a, b, n;
    cin >> a >> b >> n;

    unsigned long long num = a;

    for (int i = 0; i < n; i++)
    {
        num *= 10;
        for (int j = 0; j < 9; j++)
        {
            if (num % b == 0)
                break;
            num += 1;
        }

        if (num % b != 0)
        {
            cout << -1 << '\n';
            return;
        }

        // last digit is zero, print the rest as zeros
        if (num % 10 == 0)
        {
            i++;
            cout << num;
            for (; i < n; i++)
                cout << 0;
            cout << '\n';
            return;
        }
    }

    cout << num << '\n';
}


////////////includes/////////////////
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
///////////functions/////////////
typedef long long ll;
const int INF = 1 << 29;
inline bool equal(const double& a, const double& b) { return fabs(a - b) < 1e-9; }
inline int two(const int& n) { return 1 << n; }
inline int test(const int& n, const int& b) { return (n >> b) & 1; }
inline void set_bit(int& n, const int& b) { n |= two(b); }
inline void unset_bit(int& n, const int& b) { n &= ~two(b); }
inline int last_bit(const int& n) { return n & (-n); }
inline int ones(int n)
{
    int res = 0;
    while (n && ++res)
        n -= n & (-n);
    return res;
}
template <class T>
void chmax(T& a, const T& b) { a = max(a, b); }
template <class T>
void chmin(T& a, const T& b) { a = min(a, b); }
////////////operator overloading////////////
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << "> " << #x << " = " << x << endl;
#else
    #define debug(x)
#endif

template <typename F, typename S>
ostream& operator<<(ostream& os, const pair<F, S>& p)
{
    return os << "(" << p.first << ", " << p.second << ")";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "[";
    typename vector<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
    os << "[";
    typename set<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename F, typename S>
ostream& operator<<(ostream& os, const map<F, S>& v)
{
    os << "{";
    typename map<F, S>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << it->first << ": " << it->second;
    }
    return os << "}";
}
////////////main////////////
void solution();
int main()
{
    cin.sync_with_stdio(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    solution();
    return 0;
}
/////////////////////////////////////////////////solution////////////////////////////////////////////////////////////

void solution()
{
    int a, b, n;
    cin >> a >> b >> n;

    unsigned long long num = a;

    for (int i = 0; i < n; i++)
    {
        num *= 10;
        for (int j = 0; j < 10; j++)
        {
            if (num % b == 0)
                break;
            num += 1;
        }

        if (num % b != 0)
        {
            cout << -1 << '\n';
            return;
        }

        // last digit is zero, print the rest as zeros
        if (num % 10 == 0)
        {
            i++;
            cout << num;
            for (; i < n; i++)
                cout << 0;
            cout << '\n';
            return;
        }
    }

    cout << num << '\n';
}


////////////includes/////////////////
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
///////////functions/////////////
typedef long long ll;
const int INF = 1 << 29;
inline bool equal(const double& a, const double& b) { return fabs(a - b) < 1e-9; }
inline int two(const int& n) { return 1 << n; }
inline int test(const int& n, const int& b) { return (n >> b) & 1; }
inline void set_bit(int& n, const int& b) { n |= two(b); }
inline void unset_bit(int& n, const int& b) { n &= ~two(b); }
inline int last_bit(const int& n) { return n & (-n); }
inline int ones(int n)
{
    int res = 0;
    while (n && ++res)
        n -= n & (-n);
    return res;
}
template <class T>
void chmax(T& a, const T& b) { a = max(a, b); }
template <class T>
void chmin(T& a, const T& b) { a = min(a, b); }
////////////operator overloading////////////
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << "> " << #x << " = " << x << endl;
#else
    #define debug(x)
#endif

template <typename F, typename S>
ostream& operator<<(ostream& os, const pair<F, S>& p)
{
    return os << "(" << p.first << ", " << p.second << ")";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "[";
    typename vector<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
    os << "[";
    typename set<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename F, typename S>
ostream& operator<<(ostream& os, const map<F, S>& v)
{
    os << "{";
    typename map<F, S>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << it->first << ": " << it->second;
    }
    return os << "}";
}
////////////main////////////
void solution();
int main()
{
    cin.sync_with_stdio(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    solution();
    return 0;
}
/////////////////////////////////////////////////solution////////////////////////////////////////////////////////////

void solution()
{
    int a, b, n;
    cin >> a >> b >> n;

    unsigned long long num = a;

    for (int i = 0; i < n; i++)
    {
        num *= 10;
        for (int j = 0; j < 10; j++)
        {
            if (num % b == 0)
                break;
            num += 1;
        }

        if (num % b != 0)
        {
            cout << -1 << '\n';
            return;
        }
    }

    cout << num << '\n';
}


////////////includes/////////////////
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
///////////functions/////////////
typedef long long ll;
const int INF = 1 << 29;
inline bool equal(const double& a, const double& b) { return fabs(a - b) < 1e-9; }
inline int two(const int& n) { return 1 << n; }
inline int test(const int& n, const int& b) { return (n >> b) & 1; }
inline void set_bit(int& n, const int& b) { n |= two(b); }
inline void unset_bit(int& n, const int& b) { n &= ~two(b); }
inline int last_bit(const int& n) { return n & (-n); }
inline int ones(int n)
{
    int res = 0;
    while (n && ++res)
        n -= n & (-n);
    return res;
}
template <class T>
void chmax(T& a, const T& b) { a = max(a, b); }
template <class T>
void chmin(T& a, const T& b) { a = min(a, b); }
////////////operator overloading////////////
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << "> " << #x << " = " << x << endl;
#else
    #define debug(x)
#endif

template <typename F, typename S>
ostream& operator<<(ostream& os, const pair<F, S>& p)
{
    return os << "(" << p.first << ", " << p.second << ")";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "[";
    typename vector<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
    os << "[";
    typename set<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename F, typename S>
ostream& operator<<(ostream& os, const map<F, S>& v)
{
    os << "{";
    typename map<F, S>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << it->first << ": " << it->second;
    }
    return os << "}";
}
////////////main////////////
void solution();
int main()
{
    cin.sync_with_stdio(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    solution();
    return 0;
}
/////////////////////////////////////////////////solution////////////////////////////////////////////////////////////

void solution()
{
    int a, b, n;
    cin >> a >> b >> n;

    unsigned long long num = a;

    for (int i = 0; i < n; i++)
    {
        num *= 10;
        for (int j = 0; j < 10; j++)
        {
            if (num % b == 0)
                break;
            num += 1;
        }

        if (num % b != 0)
        {
            cout << -1 << '\n';
            return;
        }

        // last digit is zero, print the rest as zeros
        if (num % 10 == 0)
        {
            for (; i < n; i++)
                cout << 0;
            cout << '\n';
            return;
        }
    }

    cout << num << '\n';
}


////////////includes/////////////////
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
///////////functions/////////////
typedef long long ll;
const int INF = 1 << 29;
inline bool equal(const double& a, const double& b) { return fabs(a - b) < 1e-9; }
inline int two(const int& n) { return 1 << n; }
inline int test(const int& n, const int& b) { return (n >> b) & 1; }
inline void set_bit(int& n, const int& b) { n |= two(b); }
inline void unset_bit(int& n, const int& b) { n &= ~two(b); }
inline int last_bit(const int& n) { return n & (-n); }
inline int ones(int n)
{
    int res = 0;
    while (n && ++res)
        n -= n & (-n);
    return res;
}
template <class T>
void chmax(T& a, const T& b) { a = max(a, b); }
template <class T>
void chmin(T& a, const T& b) { a = min(a, b); }
////////////operator overloading////////////
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << "> " << #x << " = " << x << endl;
#else
    #define debug(x)
#endif

template <typename F, typename S>
ostream& operator<<(ostream& os, const pair<F, S>& p)
{
    return os << "(" << p.first << ", " << p.second << ")";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "[";
    typename vector<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
    os << "[";
    typename set<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename F, typename S>
ostream& operator<<(ostream& os, const map<F, S>& v)
{
    os << "{";
    typename map<F, S>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << it->first << ": " << it->second;
    }
    return os << "}";
}
////////////main////////////
void solution();
int main()
{
    cin.sync_with_stdio(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    solution();
    return 0;
}
/////////////////////////////////////////////////solution////////////////////////////////////////////////////////////

void solution()
{
    int a, b, n;
    cin >> a >> b >> n;

    unsigned long long num = a;

    for (int i = 0; i < n; i++)
    {
        num *= 10;
        for (int j = 0; j < 10; j++)
        {
            if (num % b == 0)
                break;
            num += 1;
        }

        if (num % b != 0)
        {
            cout << -1 << '\n';
            return;
        }

        // last digit is zero, print the rest as zeros
        if (num % 10 == 0)
        {
            cout << num;
            for (; i < n; i++)
                cout << 0;
            cout << '\n';
            return;
        }
    }

    cout << num << '\n';
}


////////////includes/////////////////
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
///////////functions/////////////
typedef long long ll;
const int INF = 1 << 29;
inline bool equal(const double& a, const double& b) { return fabs(a - b) < 1e-9; }
inline int two(const int& n) { return 1 << n; }
inline int test(const int& n, const int& b) { return (n >> b) & 1; }
inline void set_bit(int& n, const int& b) { n |= two(b); }
inline void unset_bit(int& n, const int& b) { n &= ~two(b); }
inline int last_bit(const int& n) { return n & (-n); }
inline int ones(int n)
{
    int res = 0;
    while (n && ++res)
        n -= n & (-n);
    return res;
}
template <class T>
void chmax(T& a, const T& b) { a = max(a, b); }
template <class T>
void chmin(T& a, const T& b) { a = min(a, b); }
////////////operator overloading////////////
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << "> " << #x << " = " << x << endl;
#else
    #define debug(x)
#endif

template <typename F, typename S>
ostream& operator<<(ostream& os, const pair<F, S>& p)
{
    return os << "(" << p.first << ", " << p.second << ")";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "[";
    typename vector<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
    os << "[";
    typename set<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename F, typename S>
ostream& operator<<(ostream& os, const map<F, S>& v)
{
    os << "{";
    typename map<F, S>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << it->first << ": " << it->second;
    }
    return os << "}";
}
////////////main////////////
void solution();
int main()
{
    cin.sync_with_stdio(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    solution();
    return 0;
}
/////////////////////////////////////////////////solution////////////////////////////////////////////////////////////

void solution()
{
    int a, b, n;
    cin >> a >> b >> n;

    if (b == 10)
    {
        cout << a;
        for (int i = 0; i < n; i++)
        {
            cout << 0;
        }
        cout << '\n';
        return;
    }

    unsigned long long num = a;

    for (int i = 0; i < n; i++)
    {
        num *= 10;
        for (int j = 0; j < 10; j++)
        {
            if (num % b == 0)
                break;
            num += 1;
        }

        if (num % b != 0)
        {
            cout << -1 << '\n';
            return;
        }
    }

    cout << num << '\n';
}


////////////includes/////////////////
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
///////////functions/////////////
typedef long long ll;
const int INF = 1 << 29;
inline bool equal(const double& a, const double& b) { return fabs(a - b) < 1e-9; }
inline int two(const int& n) { return 1 << n; }
inline int test(const int& n, const int& b) { return (n >> b) & 1; }
inline void set_bit(int& n, const int& b) { n |= two(b); }
inline void unset_bit(int& n, const int& b) { n &= ~two(b); }
inline int last_bit(const int& n) { return n & (-n); }
inline int ones(int n)
{
    int res = 0;
    while (n && ++res)
        n -= n & (-n);
    return res;
}
template <class T>
void chmax(T& a, const T& b) { a = max(a, b); }
template <class T>
void chmin(T& a, const T& b) { a = min(a, b); }
////////////operator overloading////////////
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << "> " << #x << " = " << x << endl;
#else
    #define debug(x)
#endif

template <typename F, typename S>
ostream& operator<<(ostream& os, const pair<F, S>& p)
{
    return os << "(" << p.first << ", " << p.second << ")";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "[";
    typename vector<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename T>
ostream& operator<<(ostream& os, const set<T>& v)
{
    os << "[";
    typename set<T>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << *it;
    }
    return os << "]";
}

template <typename F, typename S>
ostream& operator<<(ostream& os, const map<F, S>& v)
{
    os << "{";
    typename map<F, S>::const_iterator it;
    for (it = v.begin(); it != v.end(); it++) {
        if (it != v.begin())
            os << ", ";
        os << it->first << ": " << it->second;
    }
    return os << "}";
}
////////////main////////////
void solution();
int main()
{
    cin.sync_with_stdio(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    solution();
    return 0;
}
/////////////////////////////////////////////////solution////////////////////////////////////////////////////////////

void solution()
{
    int a, b, n;
    cin >> a >> b >> n;

    long long num = a;

    for (int i = 0; i < n; i++)
    {
        num *= 10;
        for (int j = 0; j < 10; j++)
        {
            if (num % b == 0)
                break;
            num += 1;
        }

        if (num % b != 0)
        {
            cout << -1 << '\n';
            return;
        }
    }

    cout << num << '\n';
}