#include <bits/stdc++.h>
using namespace std;
int n, m, c, mod;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> mod;
  int arr[n], ars[m], prefix[m];
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < m; i++) cin >> ars[i];
  prefix[0] = ars[0];
  for (int i = 1; i < m; i++) {
    prefix[i] = prefix[i - 1] + ars[i];
    prefix[i] %= mod;
  }
  for (int i = 0; i < n; i++) {
    arr[i] += prefix[min(m - 1, i)];
    if (i > n - m) arr[i] -= prefix[i - (n - m + 1)];
  }
  for (auto x : arr) cout << (x + mod) % mod << ' ';
}
