#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long a[n], b[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < m; i++) cin >> b[i];
  long long second = 0;
  for (long long i = 0; i < n; i++) {
    if (i < m) second = (second + b[i]) % k;
    if (i > (n - m)) second = (second + k - b[i - (n - m + 1)]) % k;
    cout << (a[i] + second) % k << " ";
  }
  return 0;
}
