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