#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vector<int64_t> v(n), z(m);
  int64_t w0 = 0, w1, x;
  for (int i = 0; i < n; ++i) cin >> v[i];
  for (int i = 0; i < n; ++i) {
    w1 = w0;
    if (i < m) {
      cin >> z[i];
      w1 = (w1 + z[i]) % c;
    }
    if (i > n - m) w1 = (w1 + c - z[i - n + m - 1]) % c;
    if (i > 0) cout << ' ';
    cout << (v[i] + w1) % c;
    w0 = w1;
  }
  cout << endl;
  return 0;
}
