#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c, e;
  scanf("%d %d %d", &n, &m, &c);
  vector<int> a, b, prefix_sum;
  for (int(i) = (0); (i) != (n); (i) = (0) > (n) ? (i)-1 : (i) + 1)
    scanf("%d", &e), a.push_back(e);
  for (int(i) = (0); (i) != (m); (i) = (0) > (m) ? (i)-1 : (i) + 1)
    scanf("%d", &e), b.push_back(e);
  prefix_sum.push_back(0);
  for (int(i) = (0); (i) != (m); (i) = (0) > (m) ? (i)-1 : (i) + 1)
    prefix_sum.push_back(prefix_sum.back() + (b[i] % c)),
        prefix_sum[prefix_sum.size() - 1] %= c;
  for (int(I) = (0); (I) != (n); (I) = (0) > (n) ? (I)-1 : (I) + 1) {
    int i = max(0, (int)(b.size() - (a.size() - I)));
    int j = min(I, (int)(b.size() - 1));
    a[I] += prefix_sum[j + 1] - prefix_sum[i];
    a[I] = (a[I] % c + c) % c;
  }
  for (int(i) = (0); (i) != (n); (i) = (0) > (n) ? (i)-1 : (i) + 1)
    printf("%d ", a[i]);
  printf("\n");
  return 0;
}
