#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
long long a[200005], b[200005], c[200005];
int main() {
  ios_base::sync_with_stdio(false);
  long long n, i, j, k, l, m, d;
  long long mini = 2e9, maxi = -1;
  cin >> n >> m >> d;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= m; i++) cin >> b[i];
  for (i = 1; i <= m; i++) mp[i] = (mp[i - 1] + b[i]) % d;
  k = n - m;
  for (i = 1; i <= m; i++) {
    c[i] = (((mp[i] - mp[i - k - 1]) + a[i]) % d + d) % d;
    cout << c[i] << " ";
  }
  for (i = 1; i <= n - m; i++) {
    c[i + m] = (((mp[m] - mp[m - (n - (m + i - 1))]) + a[i + m]) % d + d) % d;
    cout << c[i + m] << " ";
  }
  return 0;
}
