#include <bits/stdc++.h>
using namespace std;
vector<int> a, b, mas;
int n, m, c;
int main() {
  cin >> n >> m >> c;
  a.push_back(0);
  b.push_back(0);
  mas.push_back(0);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  };
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    b.push_back(x);
  };
  if (n - m >= m) {
    for (int i = 1; i <= m; i++) {
      mas.push_back(mas[i - 1] + b[i]);
      cout << (mas[i] + a[i]) % c << ' ';
    };
    for (int i = m + 1; i <= n - m + 1; i++) cout << (a[i] + mas[m]) % c << ' ';
    for (int i = n - m + 2; i <= n; i++)
      cout << (a[i] + (mas[m] - mas[i - (n - m + 1)])) % c << ' ';
  } else {
    for (int i = 1; i <= n - m; i++) {
      mas.push_back(mas[i - 1] + b[i]);
      cout << (a[i] + mas[i]) % c << ' ';
    };
    for (int i = n - m + 1; i <= m; i++) {
      mas.push_back((mas[i - 1] + b[i] - b[i - (n - m + 1)]));
      cout << (a[i] + mas[i]) % c << ' ';
    };
    for (int i = m + 1; i <= n; i++) {
      mas.push_back(mas[i - 1] - b[i - (n - m + 1)]);
      cout << (a[i] + mas[i]) % c << ' ';
    };
  };
  return 0;
}
