#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y, z;
  cin >> x >> y >> z;
  long long sum = 0, s, x1, y1;
  sum = x / z + y / z;
  x1 = x % z;
  y1 = y % z;
  if (x1 + y1 < z) {
    cout << sum << " 0" << '\n';
  } else {
    if (x1 > y1) {
      s = z - x1;
    } else
      s = z - y1;
    sum++;
    cout << sum << " " << s << '\n';
  }
}
