#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b,br1=0,br2=0,br3=0;
    int k;
    cin>>a>>b>>k;
    int r=k;
    cout<<r<<endl;

    if(r%2==0){
      while(r>=0){
        r-=2;
        br1++;
      }
    }
     if(r%2==1){
       while(r>=1){
        r-=2;
        br1++;
      }
    }
    cout<<br1<<endl;
    int s=b-a;
    while(s>=k){
        s-=k;
        br2++;
    }
    cout<<br2<<endl;
    cout<<s<<endl;
    if(s%2==0){
     while(s>=0){
        s-=2;
        br3++;
     }
    }else{
      while(s>=0){
        s-=2;
        br3++;
     }
    }
    cout<<br1*br2+br3;
    return 0;
}
