#include <bits/stdc++.h>
using namespace std;
template <typename T>
void vtrS(const vector<T> &ARR) {
  for (T const &val : ARR) cout << val << " ";
  cout << endl;
}
template <typename T>
void vtrV(const vector<T> &ARR) {
  for (T const &val : ARR) cout << val << endl;
}
template <typename T>
void read_vvtr(vector<vector<T>> &ARR) {
  for (vector<T> &i : ARR)
    for (T &j : i) cin >> j;
}
template <typename T>
void vvtrS(const vector<vector<T>> &ARR) {
  for (vector<T> const &i : ARR) {
    for (T const &j : i) cout << j << " ";
    cout << endl;
  }
}
template <typename T>
void vvtrNS(const vector<vector<T>> &ARR) {
  for (vector<T> const &i : ARR) {
    for (T const &j : i) cout << j;
    cout << endl;
  }
}
template <typename T>
T cntDigits(const T &N) {
  return (floor(log10(N)) + 1);
}
template <typename T>
bool isPowOfTwo(const T &N) {
  return (N && (!(N & (N - 1))));
}
template <typename T>
T lcm(T a, T b) {
  return ((a * b) / __gcd(a, b));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << std::fixed << std::setprecision(10);
  long long x{}, y{}, z{};
  cin >> x >> y >> z;
  long long need_x{z - (x % z)};
  long long need_y{z - (y % z)};
  if (need_x == need_y && need_x == z) {
    cout << (x / z) + (y / z) << " " << 0 << endl;
  } else if (need_x < need_y) {
    long long earlier{(x / z) + (y / z)};
    long long give{min(y % z, need_x)};
    x += give;
    y -= give;
    if (((x / z) + (y / z)) != earlier)
      cout << (x / z) + (y / z) << " " << give << endl;
    else
      cout << (x / z) + (y / z) << " " << 0 << endl;
  } else if (need_x > need_y) {
    long long earlier{(x / z) + (y / z)};
    long long give{min(x % z, need_y)};
    y += give;
    x -= give;
    if (((x / z) + (y / z)) != earlier)
      cout << (x / z) + (y / z) << " " << give << endl;
    else
      cout << (x / z) + (y / z) << " " << 0 << endl;
  } else {
    long long earlier{(x / z) + (y / z)};
    long long give{min(x % z, need_y)};
    y += give;
    x -= give;
    if (((x / z) + (y / z)) != earlier)
      cout << (x / z) + (y / z) << " " << give << endl;
    else
      cout << (x / z) + (y / z) << " " << 0 << endl;
  }
  return 0;
}
