#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  int *a;
  int *b;
  int *b1;
  int *b2;
  int i, j;
  a = (int *)malloc(n * sizeof(int));
  b = (int *)malloc(n * sizeof(int));
  b1 = (int *)malloc(n * sizeof(int));
  b2 = (int *)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < m; i++) {
    cin >> b[i];
    b1[i] = b[i];
    b2[i] = b[i];
  }
  j = m - 1;
  for (i = n - 1; i >= max(n - m - 1, m); i--) {
    b1[i] = b1[j];
    j--;
  }
  for (i = 1; i < m; i++) {
    b2[i] = (b2[i] + b2[i - 1]) % c;
  }
  for (i = 1; i < n - m + 1 && i < m; i++) {
    b1[i] = (b1[i] + b1[i - 1]) % c;
  }
  if (n - m + 1 < m) {
    for (i = n - m + 1; i < m; i++) {
      b1[i] = (b2[i] - b2[i - (n - m + 1)] + c) % c;
    }
    b1[n - 1] = b[m - 1];
    for (i = n - 2; i >= m; i--) {
      b1[i] = (b1[i] + b1[i + 1]) % c;
    }
  } else {
    for (i = m; i < n - m + 1; i++) {
      b1[i] = b1[m - 1];
    }
    for (i = n - 2; i >= n - m + 1; i--) {
      b1[i] = (b1[i] + b1[i + 1]) % c;
    }
  }
  for (i = 0; i < n; i++) {
    a[i] = (a[i] + b1[i]) % c;
    cout << a[i] << " ";
  }
  return 0;
}
