#include <bits/stdc++.h>
using namespace std;
int tich(int a)
{
	if (a==0) return 1;
	if (a!=0) return (2*a+1)*tich(a-1);
}
int tong(int a)
{
	if (a==0) return 1;
	if (a!=0) return (2*a+1)+tong(a-1);
}
int main ()
{
	freopen ("DQPS.inp", "r", stdin);
	freopen ("DQPS.out", "w", stdout);
	int a;
	cin>>a;
	cout << tich(a) << endl << tong (a);
}
