#include <bits/stdc++.h>
using namespace std;
int n, m, c;
vector<int> t;
int n1;
void init(int nn) {
  n1 = nn;
  t.assign(n1, 0);
}
int sum(int r) {
  int result = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) result += t[r];
  return result;
}
void inc(int i, int delta) {
  for (; i < n1; i = (i | (i + 1))) t[i] += delta;
}
int sum(int l, int r) { return sum(r) - sum(l - 1); }
void init(vector<int> a) {
  init((int)a.size());
  for (unsigned i = 0; i < a.size(); i++) inc(i, a[i]);
}
int main() {
  cin >> n >> m >> c;
  vector<int> a(n), b(m);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  vector<pair<int, int> > p(n);
  for (int i = 0; i < n; i++) {
    if (i <= n - m)
      p[i].first = 0;
    else
      p[i].first = i - n + m;
    if (i >= m - 1)
      p[i].second = m - 1;
    else
      p[i].second = i;
  }
  init(b);
  for (int i = 0; i < n; i++) {
    cout << (sum(p[i].first, p[i].second) + a[i]) % c << " ";
  }
  return 0;
}
