import math

rad = math.radians(60)

class coordinates:
  def __init__(self, x, y):
    self.x = x
    self.y = y
 
def koch(n, a, b):
  if n == 0:
    return
  s = coordinates((2.0*a.x + b.x)/3.0, (2.0*a.y + b.y)/3.0)
  t = coordinates((a.x + 2.0*b.x)/3.0, (a.y + 2.0*b.y)/3.0)
  ux = (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) + s.x
  uy = (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) + s.y
  u = coordinates(ux, uy)
  
  koch(n-1, a, s)
  print  s.x, s.y
  koch(n-1, s, u)
  print  u.x, u.y
  koch(n-1, u, t)
  print  t.x, t.y
  koch(n-1, t, b)
  
n = input()
  
p1 = coordinates(0.0, 0.0)
p2 = coordinates(100.0, 0.0)
  
print p1.x, p1.y
koch(n, p1, p2)
print p2.x, p2.y import math math rad = math.radians(60) rad math.radians(60) math.radians math radians 60 class coordinates:
  def __init__(self, x, y):
    self.x = x
    self.y = y
  coordinates def __init__(self, x, y):
    self.x = x
    self.y = y
  __init__ self.x = x self.x self x x self.y = y self.y self y y self self x x y y def koch(n, a, b):
  if n == 0:
    return
  s = coordinates((2.0*a.x + b.x)/3.0, (2.0*a.y + b.y)/3.0)
  t = coordinates((a.x + 2.0*b.x)/3.0, (a.y + 2.0*b.y)/3.0)
  ux = (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) + s.x
  uy = (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) + s.y
  u = coordinates(ux, uy)
  
  koch(n-1, a, s)
  print  s.x, s.y
  koch(n-1, s, u)
  print  u.x, u.y
  koch(n-1, u, t)
  print  t.x, t.y
  koch(n-1, t, b)
   koch if n == 0:
    return
   n == 0 n 0 return s = coordinates((2.0*a.x + b.x)/3.0, (2.0*a.y + b.y)/3.0) s coordinates((2.0*a.x + b.x)/3.0, (2.0*a.y + b.y)/3.0) coordinates (2.0*a.x + b.x)/3.0 2.0*a.x + b.x 2.0*a.x 2.0 a.x a x b.x b x 3.0 (2.0*a.y + b.y)/3.0 2.0*a.y + b.y 2.0*a.y 2.0 a.y a y b.y b y 3.0 t = coordinates((a.x + 2.0*b.x)/3.0, (a.y + 2.0*b.y)/3.0) t coordinates((a.x + 2.0*b.x)/3.0, (a.y + 2.0*b.y)/3.0) coordinates (a.x + 2.0*b.x)/3.0 a.x + 2.0*b.x a.x a x 2.0*b.x 2.0 b.x b x 3.0 (a.y + 2.0*b.y)/3.0 a.y + 2.0*b.y a.y a y 2.0*b.y 2.0 b.y b y 3.0 ux = (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) + s.x ux (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) + s.x (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) (t.x - s.x)*math.cos(rad) t.x - s.x t.x t x s.x s x math.cos(rad) math.cos math cos rad (t.y - s.y)*math.sin(rad) t.y - s.y t.y t y s.y s y math.sin(rad) math.sin math sin rad s.x s x uy = (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) + s.y uy (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) + s.y (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) (t.x - s.x)*math.sin(rad) t.x - s.x t.x t x s.x s x math.sin(rad) math.sin math sin rad (t.y - s.y)*math.cos(rad) t.y - s.y t.y t y s.y s y math.cos(rad) math.cos math cos rad s.y s y u = coordinates(ux, uy) u coordinates(ux, uy) coordinates ux uy koch(n-1, a, s) koch n-1 n 1 a s print s.x s x s.y s y koch(n-1, s, u) koch n-1 n 1 s u print u.x u x u.y u y koch(n-1, u, t) koch n-1 n 1 u t print t.x t x t.y t y koch(n-1, t, b) koch n-1 n 1 t b n n a a b b n = input() n input() input p1 = coordinates(0.0, 0.0) p1 coordinates(0.0, 0.0) coordinates 0.0 0.0 p2 = coordinates(100.0, 0.0) p2 coordinates(100.0, 0.0) coordinates 100.0 0.0 print p1.x p1 x p1.y p1 y koch(n, p1, p2) koch n p1 p2 print p2.x p2 x p2.y p2 y rad = math.radians(60) math.radians(60) rad class coordinates:
  def __init__(self, x, y):
    self.x = x
    self.y = y
  class coordinates:
  def __init__(self, x, y):
    self.x = x
    self.y = y
  coordinates p2 = coordinates(100.0, 0.0) coordinates(100.0, 0.0) p2 p1 = coordinates(0.0, 0.0) coordinates(0.0, 0.0) p1 def koch(n, a, b):
  if n == 0:
    return
  s = coordinates((2.0*a.x + b.x)/3.0, (2.0*a.y + b.y)/3.0)
  t = coordinates((a.x + 2.0*b.x)/3.0, (a.y + 2.0*b.y)/3.0)
  ux = (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) + s.x
  uy = (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) + s.y
  u = coordinates(ux, uy)
  
  koch(n-1, a, s)
  print  s.x, s.y
  koch(n-1, s, u)
  print  u.x, u.y
  koch(n-1, u, t)
  print  t.x, t.y
  koch(n-1, t, b)
   def koch(n, a, b):
  if n == 0:
    return
  s = coordinates((2.0*a.x + b.x)/3.0, (2.0*a.y + b.y)/3.0)
  t = coordinates((a.x + 2.0*b.x)/3.0, (a.y + 2.0*b.y)/3.0)
  ux = (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) + s.x
  uy = (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) + s.y
  u = coordinates(ux, uy)
  
  koch(n-1, a, s)
  print  s.x, s.y
  koch(n-1, s, u)
  print  u.x, u.y
  koch(n-1, u, t)
  print  t.x, t.y
  koch(n-1, t, b)
   koch n = input() input() n
import math

rad = math.radians(60)

class coordinates:
  def __init__(self, x, y):
    self.x = x
    self.y = y
 
def koch(n, a, b):
  if n == 0:
    return
  s = coordinates((2.0*a.x + b.x)/3.0, (2.0*a.y + b.y)/3.0)
  t = coordinates((a.x + 2.0*b.x)/3.0, (a.y + 2.0*b.y)/3.0)
  ux = (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) + s.x
  uy = (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) + s.y
  u = coordinates(ux, uy)
  
  koch(n-1, a, s)
  print  s.x, s.y
  koch(n-1, s, u)
  print  u.x, u.y
  koch(n-1, u, t)
  print  t.x, t.y
  koch(n-1, t, b)
  
n = input()
  
p1 = coordinates(0.0, 0.0)
p2 = coordinates(100.0, 0.0)
  
print p1.x, p1.y
koch(n, p1, p2)
print p2.x, p2.y