#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
#define mp make_pair
using namespace std;
int a, b, c, d, n, ans;
int ar[234567];
string s;
bool b1, b2;
signed main() {
	cin >> n >> a >> b;
	switch (n % 12)
	{
	case 0:cout << a << ' ' << b << endl; break;
	case 1:cout << a - b << ' ' << b << endl; break;
	case 2:cout << a - b << ' ' << a << endl; break;
	case 3:cout << -b << ' ' << a << endl; break;
	case 4:cout << -b << ' ' << a - b << endl; break;
	case 5:cout << -a << ' ' << a - b << endl; break;
	case 6:cout << -a << ' ' << -b << endl; break;
	case 7:cout << -a + b << ' ' << -b << endl; break;
	case 8:cout << -a + b << ' ' << -a << endl; break;
	case 9:cout << b << ' ' << -a << endl; break;
	case 10:cout << b << ' ' << -a + b << endl; break;
	case 11:cout << a << ' ' << -a + b << endl; break;
	default:
		break;
	}
}
