#include <bits/stdc++.h>
using namespace std;
template <class T>
void checkmin(T &t, T x) {
  if (x < t) t = x;
}
template <class T>
void checkmax(T &t, T x) {
  if (x > t) t = x;
}
const int N = 105555;
int m, n, c;
int a[N];
int b[N];
int main() {
  cin >> n >> m >> c;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    b[i] += b[i - 1];
    b[i] %= c;
  }
  for (int i = 1; i <= n; i++) {
    int r = min(m, i);
    int l = max(1, m - (n - i));
    if (l > r) continue;
    a[i] += b[r] - b[l - 1];
    a[i] %= c;
    a[i] += c;
    a[i] %= c;
    cout << a[i] << " ";
  }
}
