#include <bits/stdc++.h>
using namespace std;
inline char nc() {
  static char buf[1000000], *p1, *p2;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
long long rd() {
  long long x = 0;
  char ch = nc();
  while (ch < '0' || ch > '9') ch = nc();
  while (ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + ch - '0', ch = nc();
  return x;
}
const long long MAX_N = 1e6 + 6;
long long a, b, c;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> a >> b >> c;
  cout << (a + b) / c << " ";
  a %= c;
  b %= c;
  if (a + b < c) {
    cout << "0\n";
    return 0;
  }
  cout << c - max(a, b) << "\n";
  return 0;
}
