#include <bits/stdc++.h>
int const maxn = 3e5 + 10;
int const mod = 1e9 + 7;
using namespace std;
int main() {
  long long a, b, c;
  cin >> a >> b >> c;
  long long d = a % c;
  long long e = b % c;
  if (d + e < c) {
    cout << (a + b) / c << " " << 0 << endl;
  } else {
    cout << (a + b) / c << " " << min(c - d, c - e) << endl;
  }
  return 0;
}
