#include <bits/stdc++.h>
using namespace std;
int tt, x;
int n, m, cnt, ps, sum, s;
vector<int> N, M;
int main() {
  cin >> n >> m >> s;
  cnt = n - m;
  cnt++;
  for (int i = 0; i < n; i++) {
    cin >> x;
    N.push_back(x);
  }
  for (int i = 0; i < m; i++) {
    cin >> x;
    M.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    tt++;
    if (i + 1 <= m) {
      sum += M[i];
    }
    cout << (sum + N[i]) % s << ' ';
    if (tt == cnt) {
      sum -= M[ps];
      tt--;
      ps++;
    }
  }
  cout << endl;
}
