#include <bits/stdc++.h>
using namespace std;
int n, m, c, a[200000], b[200000], partto[200000];
int sum(int l, int r) { return (partto[r] - partto[l - 1] + 10000 * c) % c; }
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]);
  for (int i = 1; i <= m; i++) partto[i] = (partto[i - 1] + b[i]) % c;
  for (int i = 1; i <= n; i++) {
    int t = min(i, m);
    int q = n - max(m, i);
    int v = max(1, t - q);
    a[i] = (a[i] + sum(v, t)) % c;
    cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
