#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100005], b[100005], s[100005];
  int n, m, c;
  cin >> n >> m >> c;
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", b + i);
    s[i] = s[i - 1] + b[i];
  }
  for (int i = 1; i <= n; i++) {
    int l, r;
    l = max(m - (n - i), 1);
    r = min(i, m);
    cout << ((a[i] + s[r] - s[l - 1]) % c) << " ";
  }
  return 0;
}
