#include <bits/stdc++.h>
using namespace std;
const long long INF = 4e18;
const int inf = 2e9;
const double eps = 1e-13;
const int N = 1e5 + 5;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int mod;
int a[N];
int b[N];
void norm(int &x) {
  x %= mod;
  if (x < 0) x += mod;
}
int main(void) {
  int i, j, n, m;
  scanf("%d %d %d", &n, &m, &mod);
  for (i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (i = 1; i <= m; ++i) {
    scanf("%d", &b[i]);
    b[i] += b[i - 1];
  }
  for (i = 1; i <= n; ++i) {
    int l = max(1, m - n + i);
    int r = min(m, i);
    a[i] += b[r] - b[l - 1];
    norm(a[i]);
    printf("%d ", a[i]);
  }
  printf("\n");
  return 0;
}
