#include <bits/stdc++.h>
using namespace std;
long n, m, k, ar1[200000], s[200000], ar2[200000], l, r, c;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  cin >> m;
  cin >> k;
  for (int i = 1; i <= n; i++) cin >> ar1[i];
  for (int i = 1; i <= m; i++) cin >> ar2[i];
  for (int i = 1; i <= m; i++) s[i] = s[i - 1] + ar2[i];
  for (long i = 1; i <= n; i++) {
    r = min(i, m);
    l = max(1 + m - m, m - (n - i));
    ar1[i] = ar1[i] + s[r] - s[l - 1];
    ar1[i] %= k;
  }
  for (int i = 1; i <= n; i++) {
    if (i > 1) cout << " ";
    cout << ar1[i];
  }
  cout << endl;
  cin.get();
  cin.get();
  return 0;
}
