#include <bits/stdc++.h>
using namespace std;
long long x[100009], y[100009], s1[100009], s2[100009];
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  s1[0] = y[0];
  s2[m - 1] = y[m - 1];
  for (int i = 1; i < m; i++) {
    s1[i] = s1[i - 1] + y[i];
    s2[m - 1 - i] = s2[m - i] + y[m - 1 - i];
  }
  if (n / 2 < m) {
    for (int i = 0; i < n - m + 1; i++) {
      x[i] += s1[i];
      x[i] %= c;
    }
    int k = 0;
    for (int i = n - m + 1; i < m - 1; i++) {
      x[i] += s1[n - m + k + 1] - s1[k];
      k++;
      x[i] %= c;
    }
    for (int i = m - 1; i < n; i++) {
      x[i] += s2[i - n + m];
      x[i] %= c;
    }
  } else {
    for (int i = 0; i < m; i++) {
      x[i] += s1[i];
      x[i] %= c;
    }
    for (int i = m; i < n - m; i++) {
      x[i] += s1[m - 1];
      x[i] %= c;
    }
    for (int i = n - m; i < n; i++) {
      x[i] += s2[i - n + m];
      x[i] %= c;
    }
  }
  for (int i = 0; i < n; i++) cout << x[i] << " ";
}
