#include <bits/stdc++.h>
using namespace std;
int n, m, c;
int A[100001], B[100001], C[100001];
void doit() {
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < m; i++) cin >> B[i];
  for (int i = 0; i < n - m + 1; i++)
    for (int j = 0; j < m; j++) A[i + j] = (A[i + j] + B[j]) % c;
  for (int i = 0; i < n; i++) cout << A[i] << " ";
}
int main() {
  cin >> n >> m >> c;
  doit();
}
