#include <bits/stdc++.h>
using namespace std;
int a[100009], b[100009], ans[100009], n, m, mod;
int main() {
  cin >> n >> m >> mod;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) cin >> b[i];
  for (int i = 1; i <= m; i++) ans[i] += b[i], ans[n - m + 1 + i] -= b[i];
  for (int i = 1; i <= n; i++) ans[i] += ans[i - 1];
  for (int i = 1; i <= n; i++) cout << (a[i] + ans[i]) % mod << " ";
}
