#include <bits/stdc++.h>

using namespace std;
using lli = long long;

int main() {
    lli n;
    cin >> n;

    if (n <= 50) {
    	pair<int, int> best{-1, -1};
        for (int x = 0; x <= n; ++x)
        	for (int y = 0; y <= n; ++y)
        		if (6*x + 7*y == n)
        			best = max(best, make_pair(x, y));

        if (best.first != -1) cout << best.first << " " << best.second << "\n";
        else cout << "-1\n";
    }
    else cout << (n/6 - n%6) << " " << (n%6) << "\n";
}