#include <bits/stdc++.h>
using namespace std;
struct note {
  int l, r;
  int val, add;
} p[100100 * 4];
int a[100100], b[100100], n, m, c;
void build(int l, int r, int v) {
  p[v].l = l;
  p[v].r = r;
  p[v].add = 0;
  if (l == r) {
    p[v].val = a[l];
    return;
  }
  int mid = l + r >> 1;
  build(l, mid, v << 1);
  build(mid + 1, r, v << 1 | 1);
  p[v].val = p[v << 1].val + p[v << 1 | 1].val;
}
void add(int l, int r, int ad, int v) {
  if (p[v].l == l && p[v].r == r) {
    p[v].add += ad;
    return;
  }
  if (p[v].add) {
    p[v << 1].add += p[v].add;
    p[v << 1 | 1].add += p[v].add;
    p[v].add = 0;
  }
  int mid = p[v].l + p[v].r >> 1;
  if (r <= mid) {
    add(l, r, ad, v << 1);
  } else if (l > mid) {
    add(l, r, ad, v << 1 | 1);
  } else {
    add(l, mid, ad, v << 1);
    add(mid + 1, r, ad, v << 1 | 1);
  }
  p[v].val = p[v << 1].val + p[v << 1].add * (p[v << 1].r - p[v << 1].l + 1) +
             p[v << 1 | 1].val +
             p[v << 1 | 1].add * (p[v << 1 | 1].r - p[v << 1 | 1].l + 1);
}
int find(int i, int v) {
  if (p[v].l == p[v].r) {
    return p[v].val + p[v].add;
  }
  if (p[v].add) {
    p[v << 1].add += p[v].add;
    p[v << 1 | 1].add += p[v].add;
    p[v].val += p[v].add * (p[v].r - p[v].l + 1);
    p[v].add = 0;
  }
  int mid = p[v].l + p[v].r >> 1;
  if (mid >= i) {
    return find(i, v << 1);
  } else {
    return find(i, v << 1 | 1);
  }
}
int main() {
  while (scanf("%d%d%d", &n, &m, &c) != EOF) {
    int k = n - m;
    for (int i = 1; i <= n; i++) scanf("%d", a + i);
    for (int i = 1; i <= m; i++) scanf("%d", b + i);
    build(1, n, 1);
    for (int i = 1; i <= m; i++) {
      add(i, i + k, b[i], 1);
    }
    printf("%d", find(1, 1) % c);
    for (int i = 2; i <= n; i++) {
      printf(" %d", find(i, 1) % c);
    }
    printf("\n");
  }
  return 0;
}
