#P14574. 批话哥

批话哥

Description

There are nn people in the computer room. Today, they held a practice competition with a total of mm problems. Cynthia recorded kk events that occurred after the practice contest. The ii-th event is represented by a triple (xi,yi,vi)(x_i,y_i,v_i), meaning that person numbered xix_i told Cynthia that their score on problem yiy_i was viv_i. If someone does not tell Cynthia their score on a problem, they are considered to have scored 00 on that problem.

However, the computer room is full of Fakers. If someone tells Cynthia that their score on a problem is vv, Cynthia will believe they actually scored 100100 if vlv \leq l; 00 if vrv \geq r; and vv otherwise.

You need to help Cynthia calculate everyone's score in her mind.

Input Format

Enter five positive integers in the first line, n,m,k,l,rn,m,k,l,r, as described in the question.

The next kk lines contain three integers xi,yi,vix_i,y_i,v_i, as described in the question.

Output Format

Output a total of nn integers in one line, representing the score of each person in Cynthia's mind.

2 2 3 38 65
1 2 48
1 1 85
2 1 32
48 100 

Hint

Sample Explanation

Person 1 scored 8585 and 4848 for the two problems, respectively. Since 8565,38<48<6585 \geq 65,38 < 48 < 65, in Cynthia's mind, person 1's score is 0+48=480 + 48 = 48.

Person 2 scored 3232 and 3838 for the two problems, respectively. Since 323832 \leq 38, and since they did not tell Cynthia their score for the second problem, in Cynthia's mind, person 2's score is 100+0=100100 + 0 = 100.

Data range

Subtask n,mn,m \leq Score
Subtask 1 33 3030
Subtask 2 100100
Subtask 3 500500 4040

For 100%100\% of the data, it is guaranteed to meet the following conditions:

  • 1knm1 \leq k \leq nm.
  • 1l<r1001 \leq l < r \leq 100.
  • 1ik,0vi100\forall 1 \leq i \leq k,0 \leq v_i \leq 100.
  • $\forall 1 \leq i < j \leq k,(x_i,y_i) \neq (x_j,y_j)$.