#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios::sync_with_stdio(NULL);
  cout.tie(NULL);
  cin.tie(NULL);
}
const double pi = 2 * acos(0.0);
const long long oo = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int nn = 2e5 + 15;
int dx[8] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[8] = {0, 0, 1, -1, 1, -1, -1, 1};
int main() {
  fast();
  int n, m, c;
  cin >> n >> m >> c;
  int arr[nn];
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<int> keys(m);
  for (int i = 0; i < m; i++) cin >> keys[i];
  for (int i = 1; i < m; i++) keys[i] += keys[i - 1];
  for (int i = 0, j = 0; i < n - m + 1; i++, j++) {
    if (j >= m) j = m - 1;
    arr[i] += keys[j];
  }
  for (int i = n - m + 1, j = 0; i < n; i++, j++) {
    arr[i] += (keys[min(n - m + j + 1, m - 1)] - keys[j]);
  }
  for (int i = 0; i < n; i++) cout << arr[i] % c << " ";
  cout << "\n";
  return 0;
}
