#include <bits/stdc++.h>
using namespace std;
long long ans[100010], a[100010], b[100010], sum[100010];
int main() {
  int m, n, c;
  cin >> n >> m >> c;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
  }
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1];
    if (i <= m) sum[i] += b[i];
    ans[i] = sum[i];
  }
  int i = 1;
  for (int st = n - m + 2; st <= n; st++) ans[st] -= sum[i++];
  for (int i = 1; i <= n; i++) {
    ans[i] = (ans[i] + a[i]) % c;
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
