#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5);
int a[N], b[N], sum[N];
int main() {
  int n, m, c;
  scanf("%d%d%d", &n, &m, &c);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < m; i++) scanf("%d", b + i);
  for (int i = 0; i + m <= n; i++) {
    for (int j = i; j < i + m; j++) {
      a[j] += b[j - i];
    }
  }
  for (int i = 0; i < n; i++) printf("%d ", a[i] % c);
  return 0;
}
