#include<iostream> #include<cstdio> using namespace std; int main(){ int n,sum,i,j,t; while(scanf("%d",&n)&&n){ i=1; while(i*(i+1)/2<n)i++; i--; sum = 0; for(j=1;j<=i;j++){ sum += j*j; } int t = n-i*(i+1)/2; sum += t*j; printf("%d %d\n",n,sum); } return 0; }