import math

m, l, w, n, k = [int(n) for n in input().split()]
mr = [int(n) for n in input().split()]
ml = [int(n) for n in input().split()]

dd = 0
ds = 0

def get_x():
    return math.sqrt(abs(1 / m * l * w *(sum(ml) - sum(mr))))

lft = True
turn = False
while (len(ml) == 0) or (len(mr) ==0):
    if turn:
        lft = not l
                         
    if lft:
        t = ml.pop()
    else:
        t = mr.pop()

    print(get_x())      
    if abs(get_x()) <= l:
        dd = dd + 1
        turn = False
    else:
        if lft:
            ml.append(t)
        else:
            mr.append(t)
        turn = True

print(dd,ds)
