lucifer-needs-help-2

One day Lucifer and Crowley two most dangerous demons were having a fight between them that who will become the king of hell. To resolve the dispute a question was given to both of them.

Given an array of length N with elements A1 , A2, .... , An in it. M operations are needed to be performed on it. In each operation add K to each element present in the index-range of I to J (both inclusive). After performing all operations print all the elements of updated array.

One who solves the question first becomes king of hell. Since Crowley is good in programming therefore Lucifer needs your help.

Input Format
First Line of program contains single integer N. Next line contains N integers separated with a space. Next line contains single integer M. Next M lines contains three integers I, J and K respectively separated by a space.

Output Format
Output N integers of updated array in separate lines.

Constraints :

1 ≤ N ≤ 10^6
0 ≤ Ai ≤ 10^9
1 ≤ M ≤ 10^6
1 ≤ I ≤ J ≤ N
0 ≤ K ≤ 10^9

Warning : Large Input Output file. Use fast I/O.

Problem setter : Shiv Dhingra

Problem tester : Pranjul Dubey

SAMPLE INPUT
5
1 2 3 2 1
4
1 1 1
1 2 1
4 5 1
5 5 1

SAMPLE OUTPUT
3
3
3
3
3

Source: hackerearth | Difficulty: EASY
Tags: Ad-hoc


Solutions: