#include <iostream>
using namespace std;
int fac(int n){
int res = 1;
for(int i =1;i<=n;i++)res*=i;
return res;
}
int main() {
int n;
while(cin>>n){
int y1=0,y2=0;
for(int i =1;i<=n;i+=2)
y1+=fac(i);
for(int i =2;i<=n;i+=2)
y2+=fac(i);
cout<<y1<<" "<<y2<<endl;
}
}
// 64 位输出请用 printf("%lld")
原来暴力就能过啊。。。

京公网安备 11010502036488号