#include<iostream>
using namespace std;
int main()
{
    int price;
    cin>>price;
    int two = price/2000;
    int one = price/1000;
    int discountA = price-two*200;
    int discountB = price-one*100;
    if(discountA<=discountB)
    {
        cout<<discountA<<" "<<0<<endl;
    }
    else
    {
        cout<<discountB<<" "<<1<<endl;
    }
}
