#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int n, m, c;
  int sum = 0;
  scanf("%d%d%d", &n, &m, &c);
  int *a = new int[n];
  int *b = new int[m];
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 0; i < m; ++i) {
    scanf("%d", b + i);
    sum += b[i];
  }
  if (n - 2 * (m - 1) >= 0) {
    for (int i = m - 1; i <= n - m; i++) a[i] += sum;
    for (int i = 0; i < m - 1; i++)
      for (int j = 0; j < i + 1; j++) {
        a[i] += b[j];
        a[n - i - 1] += b[m - j - 1];
      }
  } else {
    for (int i = 0; i <= n - m; i++)
      for (int j = i; j < m + i; j++) a[j] += b[j - i];
  }
  for (int i = 0; i < n; ++i) {
    a[i] %= c;
    printf("%d ", a[i]);
  }
  return 0;
}
