#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
long long n, a[200005] = {}, b[200005] = {}, s[200005] = {}, m, c;
long long get(int i, int j) {
  if (j <= 0) j = 1;
  if (j > i) return 0;
  return s[i] - s[j - 1];
}
inline long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
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];
  for (int i = 1; i <= m; ++i) s[i] = s[i - 1] + b[i];
  for (int i = 1; i <= n; ++i) {
    a[i] += get(min(i, m), min(i - (n - m + 1) + 1, m));
    a[i] %= c;
  }
  for (int i = 1; i <= n; ++i) cout << a[i] << ' ';
}
