#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
const int fx[] = {+1, -1, +0, +0};
const int fy[] = {+0, +0, +1, -1};
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
const long long int N = 1e5 + 10;
long long int a[N], b[N], sum[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    long long int n, m, c;
    scanf("%lld %lld %lld", &(n), &(m), &(c));
    for (long long int i = 0; i < n; i++) {
      scanf("%lld", &(a[i]));
    }
    for (long long int i = 0; i < m; i++) {
      scanf("%lld", &(b[i]));
    }
    for (long long int i = 0; i < m; i++) {
      sum[i + 1] = sum[i] + b[i];
    }
    for (long long int i = 0; i < n; i++) {
      long long int R = min(m, i + 1);
      long long int L = max(0LL, i + m - n);
      long long int res = (a[i] + ((sum[R] - sum[L]) % c + c) % c) % c;
      cout << res << " ";
    }
  }
  return 0;
}
