#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  char c;
  bool nega = 0;
  while ((!isdigit(c = getchar())) && (c != '-'))
    ;
  if (c == '-') {
    nega = 1;
    c = getchar();
  }
  x = c - 48;
  while (isdigit(c = getchar())) x = x * 10 + c - 48;
  if (nega) x = -x;
}
template <typename T>
inline void writep(T x) {
  if (x > 9) writep(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  writep(x);
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int i, j;
  long long x, y, z, r1, r2;
  long long ret = 0;
  read(x), read(y), read(z);
  ret = x / z;
  ret += y / z;
  r1 = x % z;
  r2 = y % z;
  if (r1 + r2 >= z) {
    ret++;
    cout << ret << ' ';
    if (r1 > r2)
      cout << z - r1 << endl;
    else
      cout << z - r2 << endl;
  } else {
    cout << ret << ' ' << 0 << endl;
  }
  return 0;
}
