import math

n = int(raw_input())

th = math.pi * 60.0 / 180.0

def split(x,y):
    s = ((2*x[0]+y[0])/3, (2*x[1]+y[1])/3)
    t = ((x[0]+2*y[0])/3, (x[1]+2*y[1])/3)
    u = ((t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) + s[0], (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) + s[1])
    return (s,u,t)


s = (0.,0.)
t = (100.,0.)
points = []
points.append(s)
points.append(t)
for i in range(n):
    new_points = []
    j = 0
    while True:
        s,u,t = split(points[j],points[j+1])
        new_points.extend((points[j],s,u,t))
        j += 1
        if j+1 >= len(points): break
    new_points.append(points[j])
    points = new_points
for p in points:
    print p[0],p[1] import math math n = int(raw_input()) n int(raw_input()) int raw_input() raw_input th = math.pi * 60.0 / 180.0 th math.pi * 60.0 / 180.0 math.pi * 60.0 math.pi math pi 60.0 180.0 def split(x,y):
    s = ((2*x[0]+y[0])/3, (2*x[1]+y[1])/3)
    t = ((x[0]+2*y[0])/3, (x[1]+2*y[1])/3)
    u = ((t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) + s[0], (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) + s[1])
    return (s,u,t) split s = ((2*x[0]+y[0])/3, (2*x[1]+y[1])/3) s ((2*x[0]+y[0])/3, (2*x[1]+y[1])/3) (2*x[0]+y[0])/3 2*x[0]+y[0] 2*x[0] 2 x[0] x 0 y[0] y 0 3 (2*x[1]+y[1])/3 2*x[1]+y[1] 2*x[1] 2 x[1] x 1 y[1] y 1 3 t = ((x[0]+2*y[0])/3, (x[1]+2*y[1])/3) t ((x[0]+2*y[0])/3, (x[1]+2*y[1])/3) (x[0]+2*y[0])/3 x[0]+2*y[0] x[0] x 0 2*y[0] 2 y[0] y 0 3 (x[1]+2*y[1])/3 x[1]+2*y[1] x[1] x 1 2*y[1] 2 y[1] y 1 3 u = ((t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) + s[0], (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) + s[1]) u ((t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) + s[0], (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) + s[1]) (t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) + s[0] (t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) (t[0]-s[0])*math.cos(th) t[0]-s[0] t[0] t 0 s[0] s 0 math.cos(th) math.cos math cos th (t[1]-s[1])*math.sin(th) t[1]-s[1] t[1] t 1 s[1] s 1 math.sin(th) math.sin math sin th s[0] s 0 (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) + s[1] (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) (t[0]-s[0])*math.sin(th) t[0]-s[0] t[0] t 0 s[0] s 0 math.sin(th) math.sin math sin th (t[1]-s[1])*math.cos(th) t[1]-s[1] t[1] t 1 s[1] s 1 math.cos(th) math.cos math cos th s[1] s 1 return (s,u,t) (s,u,t) s u t x x y y s = (0.,0.) s (0.,0.) 0. 0. t = (100.,0.) t (100.,0.) 100. 0. points = [] points [] points.append(s) points.append points append s points.append(t) points.append points append t for i in range(n):
    new_points = []
    j = 0
    while True:
        s,u,t = split(points[j],points[j+1])
        new_points.extend((points[j],s,u,t))
        j += 1
        if j+1 >= len(points): break
    new_points.append(points[j])
    points = new_points i range(n) range n new_points = [] new_points [] j = 0 j 0 while True:
        s,u,t = split(points[j],points[j+1])
        new_points.extend((points[j],s,u,t))
        j += 1
        if j+1 >= len(points): break
     True s,u,t = split(points[j],points[j+1]) s split(points[j],points[j+1]) split points[j] points j points[j+1] points j+1 j 1 u t new_points.extend((points[j],s,u,t)) new_points.extend new_points extend (points[j],s,u,t) points[j] points j s u t j += 1 j 1 if j+1 >= len(points): break
     j+1 >= len(points) j+1 j 1 len(points) len points new_points.append(points[j]) new_points.append new_points append points[j] points j points = new_points points new_points for p in points:
    print p[0],p[1] p points print p[0] p 0 p[1] p 1 def split(x,y):
    s = ((2*x[0]+y[0])/3, (2*x[1]+y[1])/3)
    t = ((x[0]+2*y[0])/3, (x[1]+2*y[1])/3)
    u = ((t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) + s[0], (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) + s[1])
    return (s,u,t) def split(x,y):
    s = ((2*x[0]+y[0])/3, (2*x[1]+y[1])/3)
    t = ((x[0]+2*y[0])/3, (x[1]+2*y[1])/3)
    u = ((t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) + s[0], (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) + s[1])
    return (s,u,t) split s = (0.,0.) (0.,0.) s t = (100.,0.) (100.,0.) t j = 0 0 j th = math.pi * 60.0 / 180.0 math.pi * 60.0 / 180.0 th points = new_points new_points points points = [] [] points u,t = split(points[j],points[j+1]) split(points[j],points[j+1]) u s,u,t = split(points[j],points[j+1]) split(points[j],points[j+1]) s t = split(points[j],points[j+1]) split(points[j],points[j+1]) t j += 1 1 j new_points = [] [] new_points n = int(raw_input()) int(raw_input()) n
import math

n = int(raw_input())

th = math.pi * 60.0 / 180.0

def split(x,y):
    s = ((2*x[0]+y[0])/3, (2*x[1]+y[1])/3)
    t = ((x[0]+2*y[0])/3, (x[1]+2*y[1])/3)
    u = ((t[0]-s[0])*math.cos(th) - (t[1]-s[1])*math.sin(th) + s[0], (t[0]-s[0])*math.sin(th) + (t[1]-s[1])*math.cos(th) + s[1])
    return (s,u,t)


s = (0.,0.)
t = (100.,0.)
points = []
points.append(s)
points.append(t)
for i in range(n):
    new_points = []
    j = 0
    while True:
        s,u,t = split(points[j],points[j+1])
        new_points.extend((points[j],s,u,t))
        j += 1
        if j+1 >= len(points): break
    new_points.append(points[j])
    points = new_points
for p in points:
    print p[0],p[1]