SQRT3 = 3**0.5

class Point
  attr_accessor :x, :y
  def initialize(x,y)
    @x,@y = x,y
  end
  def print
    printf("%f %f\n",@x,@y)
  end
end

def coch(n,l,r)
  if n>0
    p1 = Point.new((l.x*2/3 + r.x/3), (l.y*2/3 + r.y/3))
    p2 = Point.new((l.x/2 + r.x/2 + l.y*SQRT3/6 - r.y*SQRT3/6), (-l.x*SQRT3/6 + r.x*SQRT3/6 + l.y/2 + r.y/2))
    p3 = Point.new((l.x/3 + r.x*2/3),(l.y/3 + r.y*2/3))
    
    coch(n-1,l,p1)
    p1.print
    coch(n-1,p1,p2)
    p2.print
    coch(n-1,p2,p3)
    p3.print
    coch(n-1,p3,r)
  end
end

left  = Point.new(  0.0, 0.0)
right = Point.new(100.0, 0.0)
n = gets.to_i
left.print
coch(n,left,right)
right.print
