import java.util.* import kotlin.math.* fun main(){ val N = readLine()!!.toInt() val cardList = mutableListOf>() repeat(N){ val (a,b) = readLine()!!.split(" ").map{it.toLong()} cardList.add(Pair(a,b)) } val c = 500000000000000000L val rlist = mutableListOf>() for(i in 0..N-1){ val fValue = abs(cardList[i].first-c).toDouble()+0.01 val bValue = abs(cardList[i].second-c).toDouble()+0.01 rlist.add(Pair(i,fValue*bValue)) } rlist.sortBy{it.second} val stack = ArrayDeque() var count = 0 for(i in 0..N-1){ if(count>=50)break if(rlist[i].first==0)break stack.add(rlist[i].first) count++ } val ansList = mutableListOf>() for(i in 0..stack.size-1){ val p = stack.removeLast() ansList.add(Pair(0,p)) } println(ansList.size) for(i in 0..ansList.size-1){ val u = ansList[i].first+1 val v = ansList[i].second+1 println("$u $v") } }