#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
using namespace std;
int n, m, mod;
int a[100005], b[100005], w[100005];
int prime(int x) {
  if (x == 1) return 0;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return 0;
  return 1;
}
int check(int x, int y) {
  if (x > n || x < 1 || y >= m || y < 0) return 0;
  return 1;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int main() {
  cin >> n >> m >> mod;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  int k = n - m + 1;
  for (int i = 0; i < n; i++) {
    if (i == 0)
      w[i] = b[i];
    else {
      w[i] = w[i - 1];
      if (i < m) w[i] += b[i];
      if (i - k >= 0) w[i] -= b[i - k];
      w[i] = (w[i] + 100 * mod) % mod;
    }
    cout << (w[i] + a[i]) % mod << " ";
  }
  return 0;
}
