#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int n, m, MOD, a[maxn], b[maxn], c[maxn], jelo;
int main() {
  cin >> n >> m >> MOD;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  cout << (a[0] + b[0]) % MOD << " ";
  c[0] = b[0];
  for (int i = 1; i < n; i++) {
    if (i - 1 < n - m)
      c[i] = c[i - 1] + b[i];
    else
      c[i] = b[i] - b[jelo++] + c[i - 1];
    cout << (a[i] + c[i]) % MOD << " ";
  }
  return 0;
}
