#include <bits/stdc++.h>
using namespace std;
int a[100010], b[100010], s[100010];
int main() {
  int n, m, i, j, k, c;
  scanf("%d%d%d", &n, &m, &c);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i] = a[i] % c;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
    b[i] = b[i] % c;
  }
  s[0] = 0;
  for (i = 1; i <= m; i++) s[i] = (s[i - 1] + b[i]) % c;
  for (i = 1; i <= n; i++) {
    j = min(m, i);
    if (i + m - 1 <= n)
      k = 1;
    else
      k = i + m - n;
    a[i] = (a[i] + s[j] - s[k - 1] + c * 10) % c;
  }
  for (i = 1; i <= n; i++) printf("%d ", a[i]);
  return 0;
}
