#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x, y, z;
  while (cin >> x >> y >> z) {
    if (x % z == 0 || (y % z == 0) || (x % z == 0 && y % z == 0)) {
      cout << (x + y) / z << " " << 0 << endl;
    } else {
      long long int sum = x + y;
      cout << sum / z << " ";
      long long int a, b;
      a = x % z;
      b = y % z;
      if (a + b >= z)
        cout << min((z - a), (z - b)) << endl;
      else
        cout << 0 << endl;
    }
  }
}
