#include <bits/stdc++.h>
using namespace std;
long long a[100100];
long long b[100100];
long long n, m, c;
long long dp[100100];
long long sol[100100];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> c;
  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++) {
    dp[i] = dp[i - 1] + b[i];
  }
  for (int i = 1; i <= n; i++) {
    if (i <= m) {
      long long t = n - i;
      long long k = m - i;
      t -= k;
      long long g = max((long long)1, i - t);
      sol[i] = a[i] + (dp[i] - dp[g - 1]);
      sol[i] %= c;
    } else {
      long long t = n - i;
      t++;
      if (t > m) t = m;
      long long g = m - t;
      sol[i] = a[i] + (dp[m] - dp[g]);
      sol[i] %= c;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << sol[i] << " ";
  }
  return 0;
}
