#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y, z;
  cin >> x >> y >> z;
  long long sum1 = x % z, sum2 = y % z;
  long long ans1 = x / z + y / z, ans2 = 0;
  if (((double)(sum1 + sum2) / z >= 1 ||
       (((sum1 + sum2) % z == 0) && (sum1 != 0 || sum2 != 0)))) {
    if (sum1 > sum2) {
      ans2 = z - sum1;
    } else {
      ans2 = z - sum2;
    }
    ans1++;
  }
  printf("%lld %lld\n", ans1, ans2);
}
