n, k = gets.split.map(&:to_i)

pairs_at_junction = [0, 1]

(2..n).each{|count|
    pairs_at_junction.push(count + pairs_at_junction.last)
}

define_method(:get_count_list){|sum, index|
    (1..index).reverse_each{|i|
        if pairs_at_junction[i] > sum
            next
        elsif pairs_at_junction[i] == sum
            return [pairs_at_junction[i]]
        else
            result = get_count_list(sum - pairs_at_junction[i], i)
            if result != nil
                return [pairs_at_junction[i]] + result
            end
        end
    }
    return nil
}

count_list = get_count_list(k, pairs_at_junction.size() - 1)
if count_list == nil || count_list.inject(:+) > n - 1
    puts -1
else
    current_num = 1
    next_num = 1
    count_list.each{|count|
        count.times{|cc|
            next_num += 1
            puts current_num.to_s + " " + next_num.to_s
        }
        current_num = next_num
    }
end
