#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long x, y, z;
  cin >> x >> y >> z;
  if (x % z == 0 || y % z == 0)
    cout << (x + y) / z << " " << 0 << endl;
  else {
    long long a = x % z;
    long long b = y % z;
    if (((a + b) / z) >= 1) {
      a = z - x % z;
      b = z - y % z;
      long long c = min(a, b);
      cout << (x + y) / z << " " << c << endl;
    } else {
      cout << (x + y) / z << " " << 0 << endl;
    }
  }
  cin >> x;
  return 0;
}
