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