The Two-dimensional kingdom is going through hard times... This morning the Three-Dimensional kingdom declared war on the Two-dimensional one. This (possibly armed) conflict will determine the ultimate owner of the straight line.

The Two-dimensional kingdom has a regular army of *n* people. Each soldier registered himself and indicated the desired size of the bulletproof vest: the *i*-th soldier indicated size *a*<sub class="lower-index">*i*</sub>. The soldiers are known to be unpretentious, so the command staff assumes that the soldiers are comfortable in any vests with sizes from *a*<sub class="lower-index">*i*</sub> - *x* to *a*<sub class="lower-index">*i*</sub> + *y*, inclusive (numbers *x*, *y* ≥ 0 are specified). 

The Two-dimensional kingdom has *m* vests at its disposal, the *j*-th vest's size equals *b*<sub class="lower-index">*j*</sub>. Help mobilize the Two-dimensional kingdom's army: equip with vests as many soldiers as possible. Each vest can be used only once. The *i*-th soldier can put on the *j*-th vest, if *a*<sub class="lower-index">*i*</sub> - *x* ≤ *b*<sub class="lower-index">*j*</sub> ≤ *a*<sub class="lower-index">*i*</sub> + *y*.
The first input line contains four integers *n*, *m*, *x* and *y* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>, 0 ≤ *x*, *y* ≤ 10<sup class="upper-index">9</sup>) — the number of soldiers, the number of vests and two numbers that specify the soldiers' unpretentiousness, correspondingly.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) in non-decreasing order, separated by single spaces — the desired sizes of vests. 

The third line contains *m* integers *b*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">2</sub>, ..., *b*<sub class="lower-index">*m*</sub> (1 ≤ *b*<sub class="lower-index">*j*</sub> ≤ 10<sup class="upper-index">9</sup>) in non-decreasing order, separated by single spaces — the sizes of the available vests.
5 3 0 0
1 2 3 3 4
1 3 5
2
1 1
3 2
3 3 2 2
1 5 9
3 5 7
3
1 1
2 2
3 3
1 1 0 0
1
1
1
1 1
1 1 0 0
1
2
0
2 3 1 4
1 5
1 2 2
1
1 1
20 30 1 4
1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 4 4 4 5
1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 4 5 5
20
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 15
14 16
15 17
16 18
17 19
18 20
19 21
20 22
33 23 17 2
1 1 2 2 2 3 3 3 3 3 3 4 4 4 4 4 5 5 5 6 6 7 7 7 8 8 8 8 8 9 9 10 10
1 1 3 3 4 4 4 5 5 6 6 6 7 8 8 8 8 8 8 9 9 10 10
23
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
12 10
13 11
14 12
17 13
20 14
21 15
22 16
23 17
24 18
25 19
26 20
27 21
28 22
29 23
2 2 1 4
1 4
3 6
2
1 1
2 2
20 20 1 4
1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 4 5 5
3 3 3 3 3 4 4 4 4 4 4 4 4 5 5 5 6 6 7 7
20
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
33 23 17 2
1 1 1 2 3 3 3 3 3 4 4 4 4 5 6 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 8 10 10
10 10 10 11 12 12 12 12 12 13 13 13 13 14 15 15 15 15 15 15 16 16 16
5
26 1
27 2
28 3
32 4
33 5
1 1 1 2
783266931
783266932
1
1 1
2 3 1 4
1 1
3 3 4
2
1 1
2 2
20 30 1 4
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
20
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
33 23 17 2
1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5
10 10 10 10 10 10 10 11 11 11 11 11 11 11 12 12 12 12 12 12 13 13 13
0
10 1 1 1
1 1 1 5 5 7 7 8 8 8
3
0
10 1 2 1
1 2 5 8 9 9 9 10 10 10
7
1
4 1
1 1 2 1
7
8
1
1 1
1 1 0 2
9
7
0
2 2 0 2
2 8
3 5
1
1 1
2 2 1 0
5 5
6 7
0
2 2 3 0
8 9
1 5
1
1 2
from sys import stdin, stdout

def closest_right(arr, target):
    '''
      Returns the minm index of a number in the array which is greater than or equal to the target.

      Parameters
      ----------
      arr : List[int]
      target : int

      Returns
      -------
      int
    '''
    l, r = -1, len(arr)
    while l+1 < r:
        m = (l+r) // 2
        if arr[m] < target:
            l = m
        else:
            r = m

    return r


def closest_left(arr, target):
    '''
      Returns the minm index of a number in the array which is less than or equal to the target.

      Parameters
      ----------
      arr : List[int]
      target : int

      Returns
      -------
      int
    '''
    l, r = -1, len(arr)
    while l + 1 < r:
        m = (l + r) // 2
        if arr[m] > target:
            r = m
        else:
            l = m

    return l


def find_range(arr, number, x, y):
    '''
      Gives a range of values in the array that is greater than number - x
      and less than number + y

      Args:
        arr (List[int]): list of non-decreasing int values
        number (int)
        x (int)
        y (int)

     Returns:
       tuple : (l, r) is returned.
    '''
    target1 = number-x if x < number else 1
    target2 = number + y
    l, r = closest_right(arr, target1), closest_left(arr, target2)
    return (l,r)


def main():
    outputs = []
    n, m, x, y = map(int, stdin.readline().strip().split())
    a = [int(num) for num in stdin.readline().strip().split()]
    b = list(map(int, stdin.readline().strip().split()))
    vest_status = [0]*m   # Array holds status of each and every vest where 0 specifies unoccupied and 1 for occupied
    for index, size_demand in enumerate(a):
        l, r = find_range(b, size_demand, x, y)
        while l <= r :
            if vest_status[l] == 0:
                vest_status[l] = 1
                outputs.append(f'{index+1} {l+1}')
                break
            l += 1
    print(len(outputs))
    for output in outputs:
        print(output)



if __name__ == '__main__':
    main()
