#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m, c;
  cin >> n >> m >> c;
  int a[n + 10];
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int b[m + 10];
  int sum[m + 10];
  sum[0] = 0;
  for (int j = 1; j <= m; ++j) {
    cin >> b[j];
    sum[j] = sum[j - 1] + b[j];
  }
  for (int i = 1; i <= n; ++i) {
    int x = i;
    if (i + m - 1 <= n)
      a[i] += sum[min(i, m)];
    else {
      int x = n + 1;
      a[i] += sum[min(i, m)] - sum[m - (x - i)];
    }
  }
  for (int i = 1; i <= n; ++i) cout << a[i] % c << ' ';
  return 0;
}
