#include <bits/stdc++.h>
using namespace std;
const int mod = 7 + 1e9;
const int inf = 1e9 + 5;
const long long INF = (long long)1e18 + 5;
const int N = 1e5 + 5;
int a[N], b[N], pre[N];
int ans[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, c;
  cin >> n >> m >> c;
  for (int i = 1; i < (int)(n + 1); i++) cin >> a[i];
  for (int i = 1; i < (int)(m + 1); i++) cin >> b[i];
  pre[1] = b[1];
  for (int i = 1; i < (int)(m + 1); i++) pre[i] = pre[i - 1] + b[i];
  for (int i = m + 1; i <= n; ++i) pre[i] = pre[m];
  for (int i = 1; i <= n - m + 1; ++i) {
    ans[i] = a[i] + pre[i];
  }
  int idx = 1;
  for (int i = n - m + 2; i <= n; ++i) {
    int id = i;
    if (i > m) id = m;
    if (idx >= m) idx = 1;
    ans[i] = a[i] + pre[id] - pre[idx];
    idx++;
  }
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] % c << " \n"[i == n];
  }
  return 0;
}
