#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int limit = 5e5;
inline int read() {
  int x = 0;
  bool f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = 0;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0';
  if (f) return x;
  return 0 - x;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const long long mod = 1e9;
const int N = 1e5 + 5;
int n, m;
int i, j, k;
int a[N];
int b[N], c;
int pre[N];
int main() {
  while (~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]), pre[i] = (pre[i - 1] + b[i]) % c;
    int cnt = 1;
    for (int i = 1; i <= (n); i++) {
      int ans;
      ans = (a[i] + pre[min(i, m)]) % c;
      if (m > n - i + 1) ans = ((ans - pre[cnt++]) % c + c) % c;
      printf("%d ", ans);
    }
  }
  return 0;
}
