#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <iomanip>
#define nextLine() { for (int c = getchar(); c != '\n' && c != EOF; c = getchar()); }
#define sqr(a) ((a)*(a))
#define has(mask,i) (((mask) & (1<<(i))) == 0 ? false : true)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define task "hotel"
using namespace std;

#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second

typedef long long LL;
typedef long double ldb;

const int inf = (1 << 30) - 1;
const ldb eps = 1e-9;
const ldb pi = fabs(atan2(0.0, -1.0));

int n;
void Load()
{
	cin >> n;
}

const int r2[3] = {0, 2, 1};
const int r3[3] = {0, -1, 0};

void Solve()
{
	cout << r2[n % 3] << " " << r3[n % 3] + (n / 3);
}

int main()
{
	freopen(task".in","r",stdin);
	freopen(task".out","w",stdout);
	Load();
	Solve();
	return 0;
}
