#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int a[N], b[N], s[N], t[4 * N], c;
void build(int v, int tl, int tr) {
  if (tl == tr)
    t[v] = b[tl];
  else {
    int tm = (tl + tr) >> 1;
    build(v * 2, tl, tm);
    build(v * 2 + 1, tm + 1, tr);
    t[v] = (t[v * 2] + t[v * 2 + 1]) % c;
  }
}
int get(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (l == tl && r == tr) return t[v];
  int tm = (tl + tr) >> 1;
  return (get(v * 2, tl, tm, l, min(tm, r)) +
          get(v * 2 + 1, tm + 1, tr, max(tm + 1, l), r)) %
         c;
}
int main() {
  int n, m;
  scanf("%d%d%d", &n, &m, &c);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  build(1, 0, m - 1);
  for (int i = 0; i < n; i++) {
    int l1 = i + m - 1;
    int r1 = l1 - (n - 1);
    if (r1 < 0)
      l1 = 0;
    else
      l1 = r1;
    int l2 = i - m + 1;
    int r2 = -l2;
    if (r2 < 0)
      l2 = m - 1;
    else
      l2 = m - 1 - r2;
    printf("%d ", (a[i] + get(1, 0, m - 1, l1, l2)) % c);
  }
  return 0;
}
