#include <bits/stdc++.h>
using namespace std;
int d2x[] = {1, -1, 0, 0, 1, -1, 1, -1};
int d2y[] = {0, 0, 1, -1, 1, -1, -1, 1};
int d3x[] = {1, -1, 0, 0, 0, 0};
int d3y[] = {0, 0, 1, -1, 0, 0};
int d3z[] = {0, 0, 0, 0, 1, -1};
struct edge {
  int from, to, w;
  edge(int from, int to, int w) : from(from), to(to), w(w) {}
  bool operator<(const edge& e) const { return w > e.w; }
};
const double EPS = (1e-9);
int n, m, c, x, s;
vector<int> a, b;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> m >> c;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x % c);
  }
  for (int i = 0; i < m; i++) {
    cin >> x;
    b.push_back(x % c);
  }
  for (int i = 0; i < n; i++) {
    if (i < m) s += b[i];
    if (i > n - m) s -= b[i - n + m - 1];
    cout << (a[i] + s) % c << " ";
  }
  return 0;
}
