The Smart Beaver from ABBYY invented a new message encryption method and now wants to check its performance. Checking it manually is long and tiresome, so he decided to ask the ABBYY Cup contestants for help.

A message is a sequence of n integers a1, a2, ..., an. Encryption uses a key which is a sequence of m integers b1, b2, ..., bm (m ≤ n). All numbers from the message and from the key belong to the interval from 0 to c - 1, inclusive, and all the calculations are performed modulo c.

Encryption is performed in n - m + 1 steps. On the first step we add to each number a1, a2, ..., am a corresponding number b1, b2, ..., bm. On the second step we add to each number a2, a3, ..., am + 1 (changed on the previous step) a corresponding number b1, b2, ..., bm. And so on: on step number i we add to each number ai, ai + 1, ..., ai + m - 1 a corresponding number b1, b2, ..., bm. The result of the encryption is the sequence a1, a2, ..., an after n - m + 1 steps.

Help the Beaver to write a program that will encrypt messages in the described manner.

Input

The first input line contains three integers n, m and c, separated by single spaces. 

The second input line contains n integers ai (0 ≤ ai < c), separated by single spaces — the original message. 

The third input line contains m integers bi (0 ≤ bi < c), separated by single spaces — the encryption key.

The input limitations for getting 30 points are: 

  * 1 ≤ m ≤ n ≤ 103
  * 1 ≤ c ≤ 103



The input limitations for getting 100 points are: 

  * 1 ≤ m ≤ n ≤ 105
  * 1 ≤ c ≤ 103

Output

Print n space-separated integers — the result of encrypting the original message.

Examples

Input

4 3 2
1 1 1 1
1 1 1


Output

0 1 1 0


Input

3 1 5
1 2 3
4


Output

0 1 2

Note

In the first sample the encryption is performed in two steps: after the first step a = (0, 0, 0, 1) (remember that the calculations are performed modulo 2), after the second step a = (0, 1, 1, 0), and that is the answer. 
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.StringTokenizer;


public class Encryption {
	
	static class Scanner{
		BufferedReader br=null;
		StringTokenizer tk=null;
		public Scanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		public String next() throws IOException{
			while(tk==null || !tk.hasMoreTokens())
				tk=new StringTokenizer(br.readLine());
			return tk.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException{
			return Integer.valueOf(next());
		}
		public double nextDouble() throws NumberFormatException, IOException{
			return Double.valueOf(next());
		}
	}
	
	static int N,M,C;
	static int[] text;
	static int[] pattern;
	
	static int f(int n, int mod){
		while(n < 0)
			n += mod;
		return n;
	}
	
	public static void main(String args[]) throws NumberFormatException, IOException{
		Scanner sc = new Scanner();
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		N = sc.nextInt();
		M = sc.nextInt();
		C = sc.nextInt();
		text = new int[N];
		pattern = new int[M];
		for(int i = 0; i < N; i++)
			text[i] = sc.nextInt();
		for(int i = 0; i < M; i++)
			pattern[i] = sc.nextInt();
		//
		int[] aux = new int[M];
		Arrays.fill(aux, 0);
		aux[0] = pattern[0];
		int[] auxsinmod = new int[M];
		auxsinmod[0] = pattern[0];
		for(int i = 1; i < M; i++){
			aux[i] = (aux[i - 1] + pattern[i]) % C;
			auxsinmod[i] = auxsinmod[i - 1] + pattern[i];
		}
		int[] ans = new int[N];
		int limit = N - M + 1;
		for(int i = 0; i < limit; i++){
			int q = Math.min(i, M - 1);
			ans[i] = (text[i] + aux[q]) % C;
		}
		for(int i = limit; i < N; i++){
			int ni = i - limit;
			int w = Math.min(M - 1, i);
			int v = auxsinmod[w] - auxsinmod[ni];
			ans[i] = (text[i] + v) % C;
		}
		for(int i = 0; i < N; i++)
			bw.write(ans[i]+" ");
		bw.write("\n");
		bw.flush();
	}

}
