#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, e = 0, f = 0;
  cin >> a >> b >> c;
  long long k = a + b;
  d = k / c;
  e = a % c, f = b % c;
  cout << d << " ";
  long long x = e + f;
  if (x / c == 0)
    cout << 0;
  else
    cout << abs(min(e, f) - x % c);
  return 0;
}
