#include <bits/stdc++.h>
using namespace std;
int n, m, i, a[110000], b[110000], c, s[110000];
int main() {
  cin >> n >> m >> c;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (i = 1; i <= m; i++) {
    cin >> b[i];
  }
  if (c == 1) {
    for (i = 1; i <= n; i++) {
      cout << 0 << " ";
    }
    return 0;
  }
  s[0] = 0;
  for (i = 1; i <= m; i++) {
    s[i] = (s[i - 1] + b[i]) % c;
  }
  if (n >= 2 * m) {
    for (i = 1; i <= n; i++) {
      if (i <= m) {
        cout << (s[i] + a[i]) % c << " ";
        continue;
      }
      if (i >= n - m + 1) {
        cout << (a[i] + c + s[m] - s[i - (n - m + 1)]) % c << " ";
        continue;
      }
      cout << (a[i] + s[m]) % c << " ";
    }
    cin >> n;
    return 0;
  }
  for (i = 1; i <= n - m; i++) {
    cout << (s[i] + a[i]) % c << " ";
  }
  for (i = n - m + 1; i <= m; i++) {
    cout << (a[i] + c + s[i] - s[i - (n - m + 1)]) % c << " ";
  }
  for (i = m + 1; i <= n; i++) {
    cout << (a[i] + c + s[m] - s[i - (n - m + 1)]) % c << " ";
  }
  cin >> n;
  return 0;
}
