#include <bits/stdc++.h>
using namespace std;
long long int a[100002], b[100002], sum[100002];
int main() {
  long long int n, m, c;
  cin >> n >> m >> c;
  for (long long int i = 0; i < n; ++i) cin >> a[i];
  for (long long int i = 0; i < m; ++i) cin >> b[i];
  sum[0] = b[0];
  for (int i = 1; i < m; ++i) {
    sum[i] += (sum[i - 1] + b[i]);
  }
  if (m != 1) {
    long long int k = m - 2;
    for (long long int i = 0; i < n; ++i) {
      if (i < n - (n - m + 1)) {
        a[i] += sum[i];
      } else {
        a[i] += sum[m - 1];
      }
    }
    for (long long int i = n - 1; k != -1; --i) {
      a[i] -= sum[k];
      --k;
    }
  } else {
    for (long long int i = 0; i < n; ++i) a[i] += b[0];
  }
  for (long long int i = 0; i < n - 1; ++i) cout << a[i] % c << " ";
  cout << a[n - 1] % c << endl;
  return 0;
}
