#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y, z;
  cin >> x >> y >> z;
  long long one = x / z;
  long long two = y / z;
  x = x % z;
  y = y % z;
  long long carry = 0;
  long long extra = 0;
  if ((x + y) / z > 0) {
    extra = (x + y) / z;
    carry = min(z - x, z - y);
  }
  cout << one + two + extra << " " << carry << "\n";
}
