object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N, K = sc.nextInt()
    val max = (N - 1) * (N - 2) / 2
    if (max < K) {
      println("-1")
    } else {
      val diff = max - K
      val combinations = (2 to N).combinations(2).take(diff)
      for (i <- 2 to N) {
        println(s"1 $i")
      }
      for (pair <- combinations) {
        println(s"${pair(0)} ${pair(1)}")
      }
    }
  }
}