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