#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c, acc = 0;
  cin >> n >> m >> c;
  int a[n], b[m];
  for (int& x : a) cin >> x;
  for (int& x : b) cin >> x;
  for (int i = 0; i < n; ++i) {
    if (i < m) acc += b[i];
    if (i - n + m - 1 >= 0) acc -= b[i - n + m - 1];
    a[i] += acc;
  }
  for (int& x : a) cout << x % c << ' ';
  return 0;
}
