#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c;
  int i, j;
  scanf("%d%d%d", &n, &m, &c);
  int *a = (int *)malloc((n + 1) * sizeof(int));
  int *b = (int *)malloc((n + 1) * sizeof(int));
  int *sb = (int *)malloc((n + 1) * sizeof(int));
  for (i = 0; i <= n - 1; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i <= m - 1; i++) {
    scanf("%d", &b[i]);
  }
  sb[0] = b[0];
  for (i = 1; i <= m - 1; i++) {
    sb[i] = (1LL * sb[i - 1] + b[i]) % c;
  }
  for (i = m; i <= n - 1; i++) {
    sb[i] = sb[i - 1];
  }
  int l = n - m;
  for (i = 0; i <= l; i++) {
    a[i] = (1LL * a[i] + sb[i]) % c;
  }
  int st = sb[l];
  j = 0;
  int k = l + 1;
  int temp;
  for (i = l + 1; i <= n - 1; i++) {
    if (k < m) {
      temp = (1LL * st - b[j] + b[k] + c) % c;
    } else {
      temp = (1LL * st - b[j] + c) % c;
    }
    a[i] = (1LL * a[i] + (1LL * st - b[j++] + (k < m ? b[k++] : 0)) + c) % c;
    st = temp;
  }
  for (i = 0; i <= n - 1; i++) {
    printf("%d ", a[i]);
  }
  return 0;
}
