class Point
  def initialize(x, y)
    @x, @y = x, y
  end

  def +(other)
    Point.new(other.x + @x, other.y + @y)
  end

  def -(other)
    Point.new(@x - other.x, @y - other.y)
  end

  def *(number)
    Point.new(@x * number, @y * number)
  end

  def /(number)
    Point.new(@x / number, @y / number)
  end

  def description
    "#{"%.8f"%(@x)} #{"%.8f"%(@y)}"
  end

  attr_reader :x, :y
end

class Line
  def initialize(start_point, end_point)
    @start_point = start_point
    @end_point = end_point
  end

  def koch_curve
    line1, line2, line3 = trisect
    s = line2.start_point
    t = line2.end_point
    radian = (radian(s, t) * 180.0 / Math::PI - 120) * Math::PI / 180.0
    ux = Math.cos(radian) * line2.length + s.x
    uy = Math.sin(radian) * line2.length + s.y
    u = Point.new(ux, uy)
    line2_1 = Line.new(line2.start_point, u)
    line2_2 = Line.new(u, line2.end_point)
    return line1, line2_1, line2_2, line3
  end

  def radian(t, s)
    Math.atan2(t.y - s.y, t.x - s.x)
  end

  def length
    a = @end_point.x - @start_point.x
    b = @end_point.y - @start_point.y
    Math.sqrt(a ** 2 + b ** 2)
  end

  def trisect
    diff = @end_point - @start_point
    line2 = Line.new @start_point + diff / 3.0, @start_point + diff / 3.0 * 2
    line1 = Line.new @start_point, line2.start_point
    line3 = Line.new line2.end_point, @end_point
    return line1, line2, line3
  end

  attr_reader :start_point, :end_point
end

n = gets.to_i
lines = [Line.new(Point.new(0.0, 0.0), Point.new(100.0, 0.0))]
n.times do
  lines = lines.flat_map{|l| l.koch_curve}
end

puts lines.first.start_point.description
lines.each {|l| puts l.end_point.description}