#include <cstdio>
#include <iostream>
using namespace std;

int main() {
    int a;
    while (scanf("%d", &a) != EOF) {
        if (a % 2 != 0) {
            // 如果有奇数只脚, 则没有满足要求的答案
            printf("0 0\n");
        } else {
            // 如果有偶数只脚, 则一定有解
            printf("%d %d\n", (a+2) / 4, a / 2);
        }
    }
    return 0;
}

// 18

// 5 9