#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m, c;
  cin >> n >> m >> c;
  vector<int> mass(n, 0);
  vector<int> key(m, 0);
  vector<int> l(n, 0);
  vector<int> r(n, m - 1);
  for (int i = 0; i < n; i++) {
    scanf("%d", &mass[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &key[i]);
  }
  for (int i = 0; i < m; i++) {
    l[n - i - 1] = m - i - 1;
    r[i] = i;
  }
  vector<int> sum(m, 0);
  sum[0] = key[0];
  for (int i = 1; i < m; i++) {
    sum[i] = sum[i - 1] + key[i];
  }
  for (int i = 0; i < n; i++) {
    if (l[i] != 0) {
      mass[i] += sum[r[i]] - sum[l[i] - 1];
    } else {
      mass[i] += sum[r[i]];
    }
    mass[i] %= c;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", mass[i]);
  }
}
