#include <bits/stdc++.h>
using namespace std;
int n, m, c;
int i, j;
int a[1000000], b[1000000], sum[1000000];
int main() {
  scanf("%d%d%d", &n, &m, &c);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
    sum[i] = b[i] + sum[i - 1];
  }
  int l, r;
  for (i = 1; i <= n; i++) {
    r = min(m, i);
    l = max(0, m - n + i - 1);
    if (i != 1) printf(" ");
    printf("%d", (a[i] + sum[r] - sum[l]) % c);
  }
  puts("");
  return 0;
}
