#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long s, m, c;
  cin >> s >> m >> c;
  if (s % c == 0 || m % c == 0)
    cout << (s + m) / c << " 0" << endl;
  else {
    long long coco = s / c + m / c;
    s = s % c;
    m = m % c;
    if (s + m >= c) {
      if (s > m)
        cout << coco + 1 << " " << c - s << endl;
      else
        cout << coco + 1 << " " << c - m << endl;
    } else
      cout << coco << " 0" << endl;
  }
  return 0;
}
