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