#include <bits/stdc++.h>
using namespace std;
long long sum[100005];
long long a[100005], b[100005];
int main() {
  long long n, m, c;
  while (cin >> n >> m >> c) {
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= m; i++) cin >> b[i];
    sum[0] = 0;
    for (int i = 1; i <= m; i++) sum[i] = sum[i - 1] + b[i];
    int te = n - m + 1;
    int t = m - 1;
    if (te < m) {
      for (int i = 1; i < te; i++) {
        a[i] += sum[i];
        a[n - i + 1] += (sum[m] - sum[m - i]);
      }
      for (int i = te; i <= n - te + 1; i++) {
        a[i] += (sum[i] - sum[i - te]);
      }
    } else {
      for (int i = 1; i <= t; i++) {
        a[i] += sum[i];
        a[n - i + 1] += (sum[m] - sum[m - i]);
      }
      for (int i = t + 1; i <= n - t; i++) {
        a[i] += sum[m];
      }
    }
    for (int i = 1; i <= n; i++) a[i] %= c;
    for (int i = 1; i <= n; i++) {
      printf("%I64d ", a[i]);
    }
    puts("");
  }
  return 0;
}
