#include <bits/stdc++.h>
int main() {
  unsigned long long a, b, c;
  fscanf(stdin, "%llu %llu %llu", &a, &b, &c);
  if (a % c + b % c < c) {
    fprintf(stdout, "%llu 0", (a + b) / c);
  } else {
    fprintf(stdout, "%llu %llu", (a + b) / c, std::min(c - a % c, c - b % c));
  }
  return 0;
}
