#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c, b;
  cin >> n >> m >> c;
  vector<int> A(n + 1), B(m + 1);
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
  }
  B[0] = 0;
  for (int i = 1; i <= m; i++) {
    cin >> b;
    B[i] = (B[i - 1] + b) % c;
  }
  if (2 * m <= n) {
    for (int k = 1; k <= m - 1; k++)
      cout << (A[k] + B[k] - B[0] + c) % c << " ";
    for (int k = m; k <= n - m; k++)
      cout << (A[k] + B[m] - B[0] + c) % c << " ";
    for (int k = n - m + 1; k <= n; k++)
      cout << (A[k] + B[m] - B[k - n + m - 1] + c) % c << " ";
    cout << endl;
  } else {
    for (int k = 1; k <= n - m; k++)
      cout << (A[k] + B[k] - B[0] + c) % c << " ";
    for (int k = n - m + 1; k <= m; k++)
      cout << (A[k] + B[k] - B[k - n + m - 1] + c) % c << " ";
    for (int k = m + 1; k <= n; k++)
      cout << (A[k] + B[m] - B[k - n + m - 1] + c) % c << " ";
    cout << endl;
  }
  return 0;
}
