#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tostr(const T& t) {
  ostringstream os;
  os << t;
  return os.str();
}
const int MAXN = 100002;
int msg[MAXN], key[MAXN], sum[MAXN];
int main(int argc, char* argv[]) {
  int n, m, MOD;
  cin >> n >> m >> MOD;
  for (int i = 0; i < n; ++i) cin >> msg[i];
  for (int i = 0; i < m; ++i) {
    cin >> key[i];
    sum[i] = key[i];
  }
  for (int i = 1; i < m; ++i) {
    sum[i] += sum[i - 1];
  }
  for (int i = 0, j = 0; i < n; ++i) {
    if (i < n - m + 1) {
      msg[i] = (msg[i] + sum[i >= m ? m - 1 : i]) % MOD;
    } else {
      msg[i] = (msg[i] + (sum[i >= m ? m - 1 : i] - sum[j])) % MOD;
      ++j;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (i > 0) cout << ' ';
    cout << msg[i];
  }
  cout << endl;
  return 0;
}
