import scala.io.StdIn.readInt

object Main {
  val angle = Math.PI/3
  def main(args:Array[String]) = {
    val n = readInt
    var list = IndexedSeq(((0D,0D),(100D,0D)))
    (1 to n).foreach { _=>
      list = for{
        i<-list;
        p1 = (i._1._1*2/3+i._2._1/3,i._1._2*2/3+i._2._2/3)
        p2 = (i._1._1/3+i._2._1*2/3,i._1._2/3+i._2._2*2/3)
        x = (p2._1-p1._1)*Math.cos(angle)-(p2._2-p1._2)*Math.sin(angle)+p1._1
        y = (p2._1-p1._1)*Math.sin(angle)+(p2._2-p1._2)*Math.cos(angle)+p1._2
        p3 = (x,y)
        j<-List((i._1,p1),(p1,p3),(p3,p2),(p2,i._2))
      } yield j
    }

    for(i<-list)
      printf("%.8f %.8f\n",i._1._1,i._1._2)
    printf("%.8f %.8f\n",list.last._2._1,list.last._2._2)
  }
}