#include <bits/stdc++.h>
using namespace std;
int n, m, c;
int a[100001], b[100001];
int main() {
  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);
    b[i] += b[i - 1];
  }
  int l = 0, r = 1;
  for (int i = 1; i <= n; ++i) {
    if (i > n - m + 1) ++l;
    a[i] += b[r] - b[l];
    if (r < m) ++r;
  }
  for (int i = 1; i <= n; ++i) printf("%d ", a[i] % c);
}
