#include <bits/stdc++.h>
using namespace std;
const int UNDEF = -1;
const int INF = 2000000000;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;
template <typename T>
const T sqr(const T &x) {
  return x * x;
}
template <typename T>
const string GetString(const T &val) {
  ostringstream sout;
  sout << val;
  return sout.str();
}
const int MAXN = 100000 + 5;
int n, m, c;
int a[MAXN], b[MAXN];
int pref[MAXN];
void Init() {
  cin >> n >> m >> c;
  for (int i = 0; i < (n); ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < (m); ++i) {
    scanf("%d", &b[i]);
    pref[i] = b[i];
    if (i) pref[i] += pref[i - 1];
  }
}
int GetSum(int l, int r) {
  int res = pref[r];
  if (l) res -= pref[l - 1];
  return res;
}
int main() {
  Init();
  int k = min(n - m + 1, m);
  int l = 0, r = 0;
  int pos = 0;
  for (int i = 0; i < (k - 1); ++i) {
    printf("%d ", (GetSum(l, r++) + a[pos++]) % c);
  }
  for (int i = 0; i < (n - 2 * (k - 1)); ++i) {
    printf("%d ", (GetSum(l, r) + a[pos++]) % c);
    if (r < m - 1 || i == n - 2 * (k - 1) - 1) ++l, ++r;
  }
  l, --r;
  for (int i = 0; i < (k - 1); ++i) {
    printf("%d ", (GetSum(l++, r) + a[pos++]) % c);
  }
  cout << endl;
  return 0;
}
