#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
const int MOD=1000000007;

int main(){
	//~ int a1=1,b1=0,a2=1,b2=0;
	//~ rep(i,100){
		//~ if(i%2==0){
			//~ a1-=a2;
			//~ b1-=b2;
		//~ }
		//~ else{
			//~ a2+=a1;
			//~ b2+=b1;
		//~ }
		//~ cout<<i<<": "<<a1<<' '<<a2<<' '<<b1<<' '<<b2<<endl;
	//~ }
	ll n,a,b;cin>>n>>a>>b;
	n%=12;
	rep(i,n){
		if(i%2==0){
			a-=b;
		}
		else b+=a;
	}
	cout<<a<<' '<<b<<endl;
}
