#include <bits/stdc++.h>
int main() {
  unsigned n, m, c;
  std::cin >> n >> m >> c;
  std::vector<unsigned> ar(n);
  for (std::vector<unsigned>::iterator it = ar.begin(), end = ar.end();
       it != end; ++it) {
    std::cin >> *it;
  }
  std::vector<unsigned> br(m);
  for (std::vector<unsigned>::iterator it = br.begin(), end = br.end();
       it != end; ++it) {
    std::cin >> *it;
  }
  if (n >= (m << 1) - 1) {
    unsigned sum = 0, p = 0;
    for (; p < m; ++p) {
      ar[p] += sum += br[p];
      ar[p] %= c;
    }
    for (unsigned lim = n - m; p <= lim; ++p) {
      ar[p] = (ar[p] + sum) % c;
    }
    for (unsigned co = 0; p < n; ++p) {
      ar[p] += sum -= br[co++];
      ar[p] %= c;
    }
  } else {
    unsigned sum = 0, p = 0, i = 0, j = n - m;
    for (; p <= j; ++p) {
      ar[p] += sum += br[p];
      ar[p] %= c;
    }
    for (++j; p < m; ++p, ++i) {
      ar[p] += sum += br[i + j] - br[i];
      ar[p] %= c;
    }
    for (; p < n; ++p, ++i) {
      ar[p] += sum -= br[i];
      ar[p] %= c;
    }
  }
  std::copy(ar.begin(), ar.end(),
            std::ostream_iterator<unsigned>(std::cout, " "));
  std::cout << std::endl;
  return 0;
}
