#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, temp;
  vector<int> mas;
  vector<int> plus;
  cin >> a >> b >> c;
  for (int i = 0; i < a; i++) {
    cin >> temp;
    mas.push_back(temp);
  }
  for (int i = 0; i < b; i++) {
    cin >> temp;
    plus.push_back(temp);
  }
  int k = 0;
  while (k + b <= a) {
    for (int j = k; j < k + b; j++) mas[j] = (mas[j] + plus[j - k]) % c;
    cout << mas[k] << " ";
    k++;
  }
  for (int h = k; h < a; h++) cout << mas[h] << " ";
  return 0;
}
