import java.util.Scanner

import scala.collection.mutable.ArrayBuffer

object Main {
  val in = new Scanner(System.in)

  def main(args: Array[String]): Unit = {
    val N = 1000
    val buffers = (0 until N).map(_ => new ArrayBuffer[Int]())

    var cur = 1
    for {
      i <- 0 until N
      j <- (i + 1) until N
    } {
      buffers(i).append(cur)
      buffers(j).append(cur)
      cur += 1
    }

    val K = buffers(0).size
    println(s"$N $K")
    buffers.foreach { buffer =>
      buffer.foreach(x => print(s"$x "))
      println()
    }
  }
}

