#include <bits/stdc++.h>
using namespace std;
int inf = 1e9;
const int N = 2e5 + 10;
long long n, m, c, a[N], prfx[N], b[N], sufx[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> c;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int x = n / m;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    prfx[i] = prfx[i - 1] + b[i];
  }
  for (int i = m; i <= n - m + 1; i++) prfx[i] = prfx[m];
  int f = 0, flag = 0;
  for (f = 1; f <= n - m + 1; f++) a[f] += prfx[f];
  int j = 1;
  for (int i = n - m + 2; i <= n; i++) {
    x = i;
    if (i >= m) x = m;
    a[i] += prfx[x] - prfx[j];
    j = j % m + 1;
  }
  for (int i = 1; i <= n; i++) cout << a[i] % c << " ";
}
