#include <bits/stdc++.h>
using namespace std;
const int Nmax = 100000;
long long a[Nmax + 1], b[Nmax + 1];
long long sum[Nmax + 1], sol[Nmax + 1];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  int n, m, c;
  cin >> n >> m >> c;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= m; i++) {
    sum[i] = sum[i - 1] + b[i];
  }
  for (int i = 1; i <= n - m + 1; i++) {
    if (i >= m) {
      sol[i] = sum[m] + a[i];
    } else {
      sol[i] = sum[i] + a[i];
    }
  }
  for (int i = n - m + 2; i <= n; i++) {
    sol[i] = sum[m] - sum[i - (n - m + 1)] + a[i];
    if (i < m) {
      sol[i] -= sum[m] - sum[i];
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << sol[i] % c << " ";
  }
  return 0;
}
