#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a = 0, b = 0, c = 0;
  cin >> a >> b >> c;
  long long d = (a + b) / c;
  cout << d << " ";
  long long e = (a / c) + (b / c);
  if (d > e) {
    cout << c - max(a % c, b % c);
  } else {
    cout << 0;
  }
  return 0;
}
