#include <bits/stdc++.h>
using namespace std;
int gcd(int n1, int n2) {
  if (n2 != 0)
    return gcd(n2, n1 % n2);
  else
    return n1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, c, m, ans, l, r;
  cin >> n >> m >> c;
  int a[n], b[m];
  for (int i = 0; i < n; ++i) cin >> a[i];
  ;
  for (int i = 0; i < m; ++i) cin >> b[i];
  ;
  long s[m];
  s[0] = b[0];
  for (int i = 1; i < m; ++i) s[i] = s[i - 1] + b[i];
  for (int i = 0; i < n; ++i) {
    r = max(0, m - n + i);
    l = min(m - 1, i);
    if (min(l, r) == 0)
      ans = s[max(l, r)];
    else
      ans = s[max(l, r)] - s[min(l, r) - 1];
    a[i] += ans;
    a[i] %= c;
  }
  for (int i = 0; i < n; ++i) cout << a[i] << " ";
  ;
  return 0;
}
