#include <bits/stdc++.h>
constexpr int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
constexpr int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll x, y, z;
  cin >> x >> y >> z;
  ll cnt = (x + y) / z;
  if (x / z + y / z == cnt)
    cout << cnt << " " << 0 << endl;
  else
    cout << cnt << " " << min((z - x % z) % z, (z - y % z) % z) << endl;
}
