#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int n, m, a[N], b[N], sum[N], c;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> c;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    sum[i] = (sum[i - 1] + b[i]) % c;
  }
  for (int i = 1; i <= n; i++) {
    int t = i, tt;
    if (t > m) t = m;
    if (i > m)
      tt = min(t, n - i + 1);
    else
      tt = min(t, n - m + 1);
    a[i] = (a[i] + sum[t] - sum[t - tt] + c * c) % c;
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  return 0;
}
