#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &c);
  int *a = new int[n];
  int *b = new int[m];
  int *temp = new int[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    temp[i] = 0;
  }
  for (int j = 0; j < m; j++) {
    scanf("%d", &b[j]);
  }
  for (int i = 0; i < n - m + 1; i++) {
    for (int j = 0; j < m; j++) {
      int b1 = b[j];
      int c2 = temp[i + j];
      temp[i + j] = (temp[i + j] + b[j]) % c;
      int c3 = temp[i + j];
    }
  }
  printf("%d", (a[0] + temp[0]) % c);
  for (int i = 1; i < n; i++) {
    printf(" %d", (a[i] + temp[i]) % c);
  }
}
