// // main.cpp // codersHigh2013 // // Created by Jereneal Kim on 13. 7. 30.. // Copyright (c) 2013년 Jereneal Kim. All rights reserved. // #include <iostream> using namespace std; int main(int argc, const char * argv[]) { long long int sum; int T,n; scanf("%d",&T); for(int iter=0;iter<T;iter++){ scanf("%d",&n); n++; sum = ((n-1)*n)/2 +1; sum*=sum; sum%=20130728; printf("%lld\n",sum); } return 0; }