#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, maxindex;
  cin >> n >> m >> k;
  vector<int> A(n), B(n + 1), Ans(n);
  maxindex = n - m;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 1; i <= m; i++) cin >> B[i];
  for (int i = 1; i <= m; i++) B[i] = (B[i] + B[i - 1]);
  for (int i = 0; i < n; i++)
    Ans[i] = (A[i] + B[min(m, i + 1)] - B[max(0, i - maxindex)]) % k;
  for (int i = 0; i < n; i++) cout << Ans[i] << " ";
  cout << endl;
}
