#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
long long x, y, z;
int main() {
  cin >> x >> y >> z;
  long long t = (x + y) / z;
  cout << t << " ";
  if (x / z + y / z == t)
    cout << 0 << endl;
  else
    cout << min((t * z - x) % z, (t * z - y) % z) << endl;
  return 0;
}
