#include <bits/stdc++.h>
using namespace std;
int a[100005] = {0};
int b[100005] = {0};
int h[100005] = {0};
int t[100005] = {0};
int main() {
  int n, m, c;
  cin >> n >> m >> c;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
  }
  h[0] = b[0] % c;
  for (int i = 1; i < m; ++i) {
    h[i] = (h[i - 1] + b[i]) % c;
  }
  t[0] = b[m - 1] % c;
  for (int i = 1; i < m; ++i) {
    t[i] = (t[i - 1] + b[m - 1 - i]) % c;
  }
  int total = h[m - 1];
  if (n >= 2 * (m - 1)) {
    for (int i = 0; i < m - 1; ++i) a[i] = (a[i] + h[i]) % c;
    for (int i = n - m + 1; i < n; ++i) a[i] = (a[i] + t[n - 1 - i]) % c;
    for (int i = m - 1; i < n - m + 1; ++i) a[i] = (a[i] + h[m - 1]) % c;
  } else {
    int gap = n - m;
    for (int i = 0; i <= gap; ++i) {
      a[i] = (a[i] + h[i]) % c;
      a[n - 1 - i] = (a[n - 1 - i] + t[i]) % c;
    }
    if (n > 2 * gap) {
      int half = (n - 2 * gap) / 2;
      gap++;
      for (int i = gap; i < gap + half; ++i) {
        a[i] = (a[i] + h[i] - h[i - gap] + c) % c;
      }
      for (int i = gap + half; i < n - gap; ++i) {
        a[i] = (a[i] + t[n - 1 - i] - t[n - 1 - i - gap] + c) % c;
      }
    }
  }
  for (int i = 0; i < n; ++i) cout << a[i] << " ";
  cout << endl;
  return 0;
}
