#include <bits/stdc++.h>
int a[100005], b[100005], t[100005];
int main() {
  int c, i, j, m, n, p, q, tmp1, tmp2;
  while (scanf("%d%d%d", &n, &m, &c) != EOF) {
    for (i = 1; i <= n; ++i) {
      scanf("%d", &a[i]);
      t[i] = 0;
    }
    for (i = 1; i <= m; ++i) scanf("%d", &b[i]);
    if (m == 1) {
      for (i = 1; i <= n; ++i) a[i] = (a[i] + b[1]) % c;
    } else if (n == m) {
      for (i = 1; i <= n; ++i) a[i] = (a[i] + b[i]) % c;
    } else {
      tmp1 = tmp2 = 0;
      for (i = 1, j = n, p = 1, q = m; i <= n - m + 1; ++i, --j, ++p, --q) {
        tmp1 += b[p];
        t[i] = tmp1 % c;
        tmp2 += b[q];
        t[j] = tmp2 % c;
        if (i == n - m + 1) break;
      }
      q = 0;
      while (i + 1 < j) {
        ++p;
        ++q;
        tmp1 += b[p] - b[q];
        t[i + 1] = tmp1;
        ++i;
      }
      for (i = 1; i <= n; ++i) a[i] = (a[i] + t[i]) % c;
    }
    for (i = 1; i < n; ++i) printf("%d ", a[i]);
    printf("%d\n", a[n]);
  }
  return 0;
}
