#include <bits/stdc++.h>
using namespace std;
const int MAXX = 100100;
int A[MAXX], B[MAXX];
pair<int, int> C[MAXX];
int getB(int a, int b) {
  if (a - 1 < 0) return B[b];
  return B[b] - B[a - 1];
}
int main() {
  int n, m, c;
  scanf("%d %d %d", &n, &m, &c);
  for (int i = 0; i < n; i++) scanf("%d", &A[i]);
  for (int i = 0; i < m; i++) scanf("%d", &B[i]);
  for (int i = 0; i < n; i++) {
    C[i].first = max(0, m - n + i);
    C[i].second = min(i, m - 1);
  }
  for (int i = 1; i < m; i++) B[i] += B[i - 1];
  for (int i = 0; i < n; i++) {
    A[i] += getB(C[i].first, C[i].second);
    A[i] %= c;
    printf("%d ", A[i]);
  }
  printf("\n");
  return 0;
}
