#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, c, ar[100009], arr[100009], ans[100009], i, x, j,
      la[100009];
  scanf("%lld", &n), scanf("%lld", &m), scanf("%lld", &c);
  for (i = 0; i < n; i++) scanf("%lld", &arr[i]);
  for (i = 0; i < m; i++) {
    scanf("%lld", &x);
    la[i] = x;
    if (i == 0)
      ar[i] = x;
    else
      ar[i] = ar[i - 1] + x;
  }
  for (i = 0; i < (n - m + 1); i++) {
    for (j = i; j <= (i + m - 1); j++) arr[j] = (arr[j] + la[j - i]) % c;
  }
  for (i = 0; i < n; i++) printf("%lld ", arr[i] % c);
  putchar('\n');
  return 0;
  for (i = 0; i < m; i++) ans[i] = (arr[i] + ar[i]) % c;
  ans[m] = (arr[m] + ar[m - 1]) % c;
  for (i = m + 1; i < (n - m + 1); i++) ans[i] = (arr[i] + ar[m - 1]) % c;
  for (i = n - m + 1; i < n; i++)
    ans[i] = (arr[i] + ar[m - 1] - ar[i - n + m - 1]) % c;
  for (i = 0; i < n; i++) printf("%lld ", ans[i] % c);
  putchar('\n');
  return 0;
}
