#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void freekick() {}
const int DX[] = {+1, 0, -1, 0, +1, +1, -1, -1};
const int DY[] = {0, +1, 0, -1, +1, -1, +1, -1};
void freegoal() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
signed main() {
  freekick();
  freegoal();
  ll n, m, x;
  cin >> n >> m >> x;
  ll a = n % x;
  ll b = m % x;
  ll c;
  if (a + b < x)
    c = 0;
  else {
    c = min(x - a, x - b);
  }
  cout << (n + m) / x << " " << c;
  return false;
}
