#include <bits/stdc++.h>
using namespace std;
int main(void) {
  unsigned long long int x, y, z;
  cin >> x >> y >> z;
  cout << (x + y) / z << " ";
  unsigned long long int donateX = x % z, donateY = y % z;
  if (donateX + donateY >= z)
    cout << min(z - donateX, z - donateY);
  else
    cout << 0;
}
