#include <bits/stdc++.h>
using namespace std;
template <class T>
int len(const T &c) {
  return (int)c.size();
}
template <class T>
void cmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
void cmax(T &a, T b) {
  if (b > a) a = b;
}
int n, t;
int m;
int c;
vector<int> vn, vm;
int main() {
  cin >> n >> m >> c;
  for (int i(0), _n(n); i < _n; ++i) {
    cin >> t;
    vn.push_back(t);
  }
  for (int i(0), _n(m); i < _n; ++i) {
    cin >> t;
    vm.push_back(t);
  }
  for (int i(0), _n(n - m + 1); i < _n; ++i) {
    for (int j(0), _n(m); j < _n; ++j) {
      vn[i + j] = (vn[i + j] + vm[j]) % c;
    }
  }
  for (int i(0), _n(n); i < _n; ++i) cout << vn[i] << " ";
}
