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