There are many freight trains departing from Kirnes planet every day. One day on that planet consists of $h$ hours, and each hour consists of $m$ minutes, where $m$ is an even number. Currently, there are $n$ freight trains, and they depart every day at the same time: $i$-th train departs at $h_i$ hours and $m_i$ minutes.

The government decided to add passenger trams as well: they plan to add a regular tram service with half-hour intervals. It means that the first tram of the day must depart at $0$ hours and $t$ minutes, where $0 \le t < {m \over 2}$, the second tram departs $m \over 2$ minutes after the first one and so on. This schedule allows exactly two passenger trams per hour, which is a great improvement.

To allow passengers to board the tram safely, the tram must arrive $k$ minutes before. During the time when passengers are boarding the tram, no freight train can depart from the planet. However, freight trains are allowed to depart at the very moment when the boarding starts, as well as at the moment when the passenger tram departs. Note that, if the first passenger tram departs at $0$ hours and $t$ minutes, where $t < k$, then the freight trains can not depart during the last $k - t$ minutes of the day.

 $O$ A schematic picture of the correct way to run passenger trams. Here $h=2$ (therefore, the number of passenger trams is $2h=4$), the number of freight trains is $n=6$. The passenger trams are marked in red (note that the spaces between them are the same). The freight trains are marked in blue. Time segments of length $k$ before each passenger tram are highlighted in red. Note that there are no freight trains inside these segments. 

Unfortunately, it might not be possible to satisfy the requirements of the government without canceling some of the freight trains. Please help the government find the optimal value of $t$ to minimize the number of canceled freight trains in case all passenger trams depart according to schedule.


-----Input-----

The first line of input contains four integers $n$, $h$, $m$, $k$ ($1 \le n \le 100\,000$, $1 \le h \le 10^9$, $2 \le m \le 10^9$, $m$ is even, $1 \le k \le {m \over 2}$) — the number of freight trains per day, the number of hours and minutes on the planet, and the boarding time for each passenger tram.

$n$ lines follow, each contains two integers $h_i$ and $m_i$ ($0 \le h_i < h$, $0 \le m_i < m$) — the time when $i$-th freight train departs. It is guaranteed that no freight trains depart at the same time.


-----Output-----

The first line of output should contain two integers: the minimum number of trains that need to be canceled, and the optimal starting time $t$. Second line of output should contain freight trains that need to be canceled.


-----Examples-----
Input
2 24 60 15
16 0
17 15

Output
0 0


Input
2 24 60 16
16 0
17 15

Output
1 0
2 



-----Note-----

In the first test case of the example the first tram can depart at 0 hours and 0 minutes. Then the freight train at 16 hours and 0 minutes can depart at the same time as the passenger tram, and the freight train at 17 hours and 15 minutes can depart at the same time as the boarding starts for the upcoming passenger tram.

In the second test case of the example it is not possible to design the passenger tram schedule without cancelling any of the freight trains: if $t \in [1, 15]$, then the freight train at 16 hours and 0 minutes is not able to depart (since boarding time is 16 minutes). If $t = 0$ or $t \in [16, 29]$, then the freight train departing at 17 hours 15 minutes is not able to depart. However, if the second freight train is canceled, one can choose $t = 0$. Another possible option is to cancel the first train and choose $t = 13$.

Difficulty: HARD

Solutions:
import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
(n, H, M, k) = MI()
hm = LLI(n)
M2 = M // 2
ll = []
rr = []
st = set([0, M2])
for (h, m) in hm:
	s = (m + 1) % M2
	ll.append(s)
	rr.append(s + k - 1)
	st.add(s)
	st.add(s + M2)
	st.add((s + k - 1) % M2)
	st.add((s + k - 1) % M2 + M2)
dec = list(sorted(st))
enc = {a: i for (i, a) in enumerate(dec)}
ln = len(dec)
tt = [0] * ln
for (l, r) in zip(ll, rr):
	tt[enc[l]] += 1
	tt[enc[r]] -= 1
for i in range(ln - 1):
	tt[i + 1] += tt[i]
for i in range(ln // 2):
	tt[i] += tt[i + ln // 2]
mn = min(tt[:ln // 2])
i = tt[:ln // 2].index(mn)
t = dec[i]
ans = []
for (i, (l, r)) in enumerate(zip(ll, rr)):
	if l <= t < r or l <= t + M2 < r:
		ans.append(i + 1)
print(mn, t)
print(*ans)


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, H, M, K, HM):
	assert M % 2 == 0
	HALFHOUR = M // 2
	freightTimes = [(h * M + m) % HALFHOUR for (h, m) in HM]
	freightTimes.sort()
	freightTimes = freightTimes + [x + HALFHOUR for x in freightTimes]
	window = deque()
	freq = Counter()
	best = (float('inf'),)
	for x in freightTimes:
		window.append(x)
		freq[x] += 1
		while x - window[0] > K:
			freq[window.popleft()] -= 1
		if x >= K:
			if window:
				cost = len(window)
				if window[-1] - window[0] == K:
					cost -= freq[window[-1]]
					cost -= freq[window[0]]
				else:
					cost -= freq[window[-1]]
				best = min(best, (cost, x % HALFHOUR))
	(covered, t) = best
	cancel = []
	for (i, (h, m)) in enumerate(HM):
		m = m % HALFHOUR
		if t - K < 0:
			if 0 <= m < t or (t - K) % HALFHOUR < m < HALFHOUR:
				cancel.append(str(i + 1))
		elif t - K < m < t:
			cancel.append(str(i + 1))
	assert len(cancel) == covered
	return str(len(cancel)) + ' ' + str(t) + '\n' + ' '.join(cancel)
if False:
	import random
	random.seed(0)
	for _ in range(10000):
		N = random.randint(1, 100)
		H = random.randint(1, 24)
		M = random.randint(1, 30) * 2
		K = random.randint(1, M // 2)
		HM = [(random.randint(0, H - 1), random.randint(0, M - 1)) for i in range(N)]
		solve(N, H, M, K, HM)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(N, H, M, K) = [int(x) for x in input().split()]
HM = [[int(x) for x in input().split()] for i in range(N)]
ans = solve(N, H, M, K, HM)
print(ans)


from sys import stdin
(n, h, m, k) = map(int, stdin.readline().split())
now = 0
ends = []
starts = []
ppp = [0] * n
for i in range(n):
	(hi, mi) = map(int, stdin.readline().split())
	if mi >= m // 2:
		pz = mi - m
	else:
		pz = mi
	if 0 <= pz < m // 2:
		starts.append((pz, i))
	if -k < pz <= m // 2 - k:
		ends.append((pz, i))
		if -k < pz < 0:
			now += 1
			ppp[i] = 1
	if m // 2 <= mi < m:
		starts.append((mi - m // 2, i))
	if m // 2 - k < mi <= m - k:
		ends.append((mi - m // 2, i))
		if m // 2 - k < mi < m // 2:
			now += 1
			ppp[i] = 1
ends.sort()
starts.sort()
ends.append((float('inf'), 0))
starts.append((float('inf'), 0))
ei = 0
si = 0
sub = now
ans = now
while ei != len(ends) - 1 or si != len(starts) - 1:
	if ends[ei][0] <= starts[si][0] - k:
		now -= 1
		ei += 1
	else:
		si += 1
		now += 1
	ans = min(ans, now)
import sys
ei = 0
si = 0
now = sub
nt = 0
if ans == now:
	print(ans, nt)
	ll = []
	for i in range(n):
		if ppp[i] == 1:
			ll.append(i + 1)
	print(*ll)
	sys.exit()
while ei != len(ends) - 1 or si != len(starts) - 1:
	nt = 0
	if ends[ei][0] <= starts[si][0] - k:
		nt = ends[ei][0] + k
		now -= 1
		ppp[ends[ei][1]] = 0
		ei += 1
	else:
		nt = starts[si][0]
		ppp[starts[si][1]] = 1
		si += 1
		now += 1
	if ans == now:
		print(ans, nt)
		ll = []
		for i in range(n):
			if ppp[i] == 1:
				ll.append(i + 1)
		print(*ll)
		sys.exit()


import sys
import re

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	(n, h, m, k) = mints()
	m //= 2
	a = [0] * n
	e = [None] * (2 * n + 2)
	c = 0
	for i in range(n):
		(hh, mm) = mints()
		x = mm % m
		a[i] = mm
		e[2 * i] = ((x + k) % m, -1, i)
		e[2 * i + 1] = ((x + 1) % m, 1, i)
		if (x + 1) % m > (x + k) % m:
			c += 1
	e[2 * n] = (0, 0, 0)
	e[2 * n + 1] = (m - 1, 0, 0)
	e.sort()
	p = -1
	r = (int(1000000000.0), 0)
	for (x, t, id) in e:
		if p != x and p != -1:
			r = min(r, (c, p))
		p = x
		c += t
	r = min(r, (c, p))
	print(*r)
	p = r[1]
	for i in range(n):
		mm = a[i]
		x = (mm - p) % m
		if (x + 1) % m > (x + k) % m and (x + k) % m != 0 or ((x + 1) % m < (x + k) % m and (x + 1) % m == 0):
			print(i + 1, end=' ')
solve()


(n, H, M, k) = map(int, input().split())
hm = []
for i in range(n):
	hm.append(list(map(int, input().split())))
M2 = M // 2
ll = []
rr = []
st = {0, M2}
for (h, m) in hm:
	s = (m + 1) % M2
	ll.append(s)
	rr.append(s + k - 1)
	st.add(s)
	st.add(s + M2)
	st.add((s + k - 1) % M2)
	st.add((s + k - 1) % M2 + M2)
dec = list(sorted(st))
enc = {a: i for (i, a) in enumerate(dec)}
ln = len(dec)
tt = [0] * ln
for (l, r) in zip(ll, rr):
	tt[enc[l]] += 1
	tt[enc[r]] -= 1
for i in range(ln - 1):
	tt[i + 1] += tt[i]
for i in range(ln // 2):
	tt[i] += tt[i + ln // 2]
mn = min(tt[:ln // 2])
i = tt[:ln // 2].index(mn)
t = dec[i]
ans = []
for (i, (l, r)) in enumerate(zip(ll, rr)):
	if l <= t < r or l <= t + M2 < r:
		ans.append(i + 1)
print(mn, t)
print(*ans)