#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> a(n), b(m);
  int tmp;
  for (int i = 0; i < n; ++i) {
    cin >> tmp;
    a[i] = tmp;
  }
  for (int i = 0; i < m; ++i) {
    cin >> tmp;
    b[i] = tmp;
  }
  int prev_min = 0, prev_max = 0, cur_min, cur_max;
  int toPlus = b[0];
  a[0] = (a[0] + toPlus) % c;
  for (int i = 1; i < n; ++i) {
    cur_max = i - max(0, i - m + 1);
    cur_min = i - min(i, n - m);
    if (cur_min > prev_min) toPlus -= b[prev_min];
    if (cur_min < prev_min) toPlus += b[cur_min];
    if (cur_max > prev_max) toPlus += b[cur_max];
    if (cur_max < prev_max) toPlus -= b[prev_max];
    a[i] = (a[i] + toPlus) % c;
    prev_min = cur_min;
    prev_max = cur_max;
  }
  for (int i = 0; i < n; ++i) cout << a[i] << " ";
  cin >> n;
  return 0;
}
