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