#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  int c;
  cin >> n;
  cin >> m;
  cin >> c;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> b(m);
  for (int i = 0; i < m; i++) cin >> b[i];
  bool s = true;
  for (int i = 0; s; i++) {
    for (int j = 0; j < m && s; j++) {
      a[i + j] = a[i + j] + b[j];
      a[i + j] %= c;
      if (j == m - 1 && i + m == n) s = false;
    }
  }
  for (int i = 0; i < n; i++) cout << a[i] << ' ';
  return 0;
}
