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