#include <bits/stdc++.h>
using namespace std;
long long Hash(char* s, int sz) {
  const int p = 31;
  long long hash = 0, p_pow = 1;
  for (size_t i = 0; i < sz; ++i) {
    hash += (s[i] - 'a' + 1) * p_pow;
    p_pow *= p;
  }
  return hash;
}
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int a[100042];
int key[100042];
int main() {
  int n, m, c;
  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", &key[i]);
  int sum = key[0];
  int prev = 0;
  for (int i = 0; i < n; i++) {
    a[i] += sum;
    sum += key[i + 1];
    if (i - prev >= n - m) sum -= key[prev++];
    printf("%d ", a[i] % c);
  }
}
