#include <bits/stdc++.h>
using namespace std;
void solve() {
  int64_t n, m, c;
  cin >> n >> m >> c;
  int64_t arr[n];
  for (int64_t i = 0; i < n; i++) cin >> arr[i];
  int64_t operations[m];
  for (int64_t i = 0; i < m; i++) cin >> operations[i];
  pair<queue<int64_t>, int64_t> q;
  for (int64_t i = 0; i < n; i++) {
    if (i < m) {
      q.first.push(operations[i]);
      q.second += operations[i];
    }
    if (i >= n - m + 1) {
      q.second -= q.first.front();
      q.first.pop();
    }
    arr[i] += q.second;
    arr[i] = arr[i] % c;
  }
  for (int64_t i = 0; i < n; i++) cout << arr[i] << " ";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int64_t test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
