#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c, i;
  cin >> n >> m >> c;
  vector<int> a(n + 1);
  vector<int> ans(n + 1);
  vector<int> b(m + 1);
  vector<int> sum(n + 1);
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= m; i++) {
    cin >> b[i];
    sum[i] = sum[i - 1] + b[i];
  }
  for (i = m + 1; i <= n; i++) sum[i] = sum[i - 1];
  for (i = 0; i <= n; i++) ans[i] = sum[i];
  for (i = n; i > n - m + 1; i--) ans[i] -= sum[i - n + m - 1];
  for (i = 1; i <= n; i++) cout << (ans[i] + a[i]) % c << " ";
  return 0;
}
