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