#include <bits/stdc++.h>
using namespace std;
int n, m, c;
int a[200001], b[200001];
void sd(int k) {
  int v = b[k - 1], v1;
  for (int i = k; i <= m + k - 1; i++) {
    v1 = b[i];
    b[i] = v;
    v = v1;
  }
  b[k - 1] = 0;
  return;
}
int main() {
  cin >> n >> m;
  cin >> c;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  for (int i = m; i < n; i++) b[i] = 0;
  for (int i = 0; i < n - m + 1; i++) {
    for (int j = 0; j < n; j++) {
      a[j] += b[j];
      a[j] = a[j] % c;
    }
    sd(i + 1);
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
