str = gets.split
N,K = str[0].to_i, str[1].to_i
a = 0
if K > N*(N-1)/2 - (N-1)
    puts -1
    exit(0)
else
    a = N*(N-1)/2 - (N-1) - K
end

for x in 2..N do
    print "1 ",x
    puts
end
i = 2
j = 3
while a > 0
    print i," ",j
    puts
    a -= 1
    if j < N
        j += 1
    else
        i += 1
        j = i+1
    end
end