#include <bits/stdc++.h>
using namespace std;
long long n, m, c, a[100100], b[100100], acc[100100];
int main() {
  cin >> n >> m >> c;
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &a[i]);
  }
  for (int i = 0; i < m; ++i) scanf("%lld", &b[i]);
  acc[0] = b[0];
  for (int i = 1; i < m; ++i) acc[i] = acc[i - 1] + b[i];
  for (int i = 0; i < n; ++i) {
    int l = 0, r = m - 1;
    if (m - 1 >= i) r = i;
    int x = n - 1 - i;
    if (m - 1 - x >= 0) l = m - 1 - x;
    printf("%lld ", (acc[r] - (l ? acc[l - 1] : 0) + a[i]) % c);
  }
}
