#include <bits/stdc++.h>
const int MAX = (int)1e5 + 5;
int a[MAX], b[MAX], n, m, c;
int main() {
  scanf("%d%d%d", &n, &m, &c);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i <= m; i++) {
    scanf("%d", b + i);
    b[i] = (b[i] + b[i - 1]) % c;
  }
  for (int i = 1; i <= n; i++) {
    a[i] = (i <= n - m + 1
                ? (a[i] + (i >= m ? b[m] : b[i])) % c
                : (a[i] + c + b[(i >= m) ? m : i] - b[m - 1 - (n - i)]) % c);
    printf("%d ", a[i]);
  }
  return 0;
}
