Gophers

No attempts yetTime limit3sMemory limit128 MB

Problem

Dick Dastardly wants to torment the gophers living along a straight mountain ridge. The ridge has nn gopher holes in a row, indexed 11 to nn from west to east. Hole 11 sits at the origin (distance 00), and hole ii (for 2in2 \le i \le n) sits xix_i meters east of hole 11, with x2<x3<<xnx_2 < x_3 < \cdots < x_n.

Dick placed mm CD players along the ridge; player jj sits zjz_j meters east of hole 11. Each player disturbs every hole within ll meters of it: a hole at distance pp from hole 11 is disturbed by a player at distance zz whenever pzl|p - z| \le l. A hole's gopher cannot sleep if at least one CD player disturbs that hole.

Over dd days the players are rearranged. On the morning of day ii, Dick moves the player currently located pip_i meters from hole 11 to a point rir_i meters from hole 11. Immediately before each move, position pip_i holds exactly one player and position rir_i holds none.

Report the number of holes whose gophers cannot sleep at the required moments.

Input

The first line contains four integers nn, mm, dd, ll (2n,m5000002 \le n, m \le 500000, 1d5000001 \le d \le 500000, 1l1091 \le l \le 10^9): the number of holes, the number of CD players, the number of days, and each player's range.

The second line contains n1n-1 integers x2,x3,,xnx_2, x_3, \ldots, x_n (0<x2<x3<<xn1090 < x_2 < x_3 < \cdots < x_n \le 10^9): the distances of holes 2,3,,n2, 3, \ldots, n from hole 11.

The third line contains mm integers z1,z2,,zmz_1, z_2, \ldots, z_m (0z1<z2<<zm1090 \le z_1 < z_2 < \cdots < z_m \le 10^9): the distances of the CD players from hole 11; every player lies east of hole 11.

Each of the next dd lines contains two integers pip_i and rir_i (0pi,ri1090 \le p_i, r_i \le 10^9, pirip_i \ne r_i): on day ii the player at distance pip_i is moved to distance rir_i. Immediately before each move a player is guaranteed to be at position pip_i and no player is at position rir_i.

Output

Output d+1d + 1 lines. For i=1,2,,di = 1, 2, \ldots, d, line ii must contain the number of sleepless holes in the state just before the ii-th move. Line d+1d + 1 must contain the number of sleepless holes after the last move.

(Equivalently: print the count for the initial arrangement, then, after applying each of the dd moves in order, print the new count.)