
p1 = [0,0]
p2 = [100,0]
R = [[0.5,-1.7320508/2],[1.7320508/2,0.5]]

def dot(A,b):
    vs = [0,0]
    for i in range(2):
        for j in range(2):
            vs[i] += A[i][j]*b[j]
    return vs

def diff(p1,p2):
    return [(p1[0]-p2[0])/3.0,(p1[1]-p2[1])/3.0]

def sumV(p1,p2):
    return [p1[0]+p2[0],p1[1]+p2[1]]

def new_koch(p1,p2):
    p = diff(p2,p1)
    p_new1 = sumV(p1,p)
    p_new2 = sumV(p_new1,dot(R,p))
    p_new3 = sumV(p1,sumV(p,p))
    return [p1,p_new1,p_new2,p_new3]

n = int(input())
ps = [p1,p2]
for i in range(n):    
    X = len(ps)
    ps_new = []
    for i in range(X-1):
        ps_new.extend(new_koch(ps[i],ps[i+1]))
    ps_new += [ps[-1]]
    ps = [p for p in ps_new]

for p in ps:
    print(*p)

 p1 = [0,0] p1 [0,0] 0 0 p2 = [100,0] p2 [100,0] 100 0 R = [[0.5,-1.7320508/2],[1.7320508/2,0.5]] R [[0.5,-1.7320508/2],[1.7320508/2,0.5]] [0.5,-1.7320508/2] 0.5 -1.7320508/2 -1.7320508 2 [1.7320508/2,0.5] 1.7320508/2 1.7320508 2 0.5 def dot(A,b):
    vs = [0,0]
    for i in range(2):
        for j in range(2):
            vs[i] += A[i][j]*b[j]
    return vs dot vs = [0,0] vs [0,0] 0 0 for i in range(2):
        for j in range(2):
            vs[i] += A[i][j]*b[j]
     i range(2) range 2 for j in range(2):
            vs[i] += A[i][j]*b[j]
     j range(2) range 2 vs[i] += A[i][j]*b[j] vs[i] vs i A[i][j]*b[j] A[i][j] [i] A i j b[j] b j return vs vs A A b b def diff(p1,p2):
    return [(p1[0]-p2[0])/3.0,(p1[1]-p2[1])/3.0] diff return [(p1[0]-p2[0])/3.0,(p1[1]-p2[1])/3.0] [(p1[0]-p2[0])/3.0,(p1[1]-p2[1])/3.0] (p1[0]-p2[0])/3.0 p1[0]-p2[0] p1[0] p1 0 p2[0] p2 0 3.0 (p1[1]-p2[1])/3.0 p1[1]-p2[1] p1[1] p1 1 p2[1] p2 1 3.0 p1 p1 p2 p2 def sumV(p1,p2):
    return [p1[0]+p2[0],p1[1]+p2[1]] sumV return [p1[0]+p2[0],p1[1]+p2[1]] [p1[0]+p2[0],p1[1]+p2[1]] p1[0]+p2[0] p1[0] p1 0 p2[0] p2 0 p1[1]+p2[1] p1[1] p1 1 p2[1] p2 1 p1 p1 p2 p2 def new_koch(p1,p2):
    p = diff(p2,p1)
    p_new1 = sumV(p1,p)
    p_new2 = sumV(p_new1,dot(R,p))
    p_new3 = sumV(p1,sumV(p,p))
    return [p1,p_new1,p_new2,p_new3] new_koch p = diff(p2,p1) p diff(p2,p1) diff p2 p1 p_new1 = sumV(p1,p) p_new1 sumV(p1,p) sumV p1 p p_new2 = sumV(p_new1,dot(R,p)) p_new2 sumV(p_new1,dot(R,p)) sumV p_new1 dot(R,p) dot R p p_new3 = sumV(p1,sumV(p,p)) p_new3 sumV(p1,sumV(p,p)) sumV p1 sumV(p,p) sumV p p return [p1,p_new1,p_new2,p_new3] [p1,p_new1,p_new2,p_new3] p1 p_new1 p_new2 p_new3 p1 p1 p2 p2 n = int(input()) n int(input()) int input() input ps = [p1,p2] ps [p1,p2] p1 p2 for i in range(n):    
    X = len(ps)
    ps_new = []
    for i in range(X-1):
        ps_new.extend(new_koch(ps[i],ps[i+1]))
    ps_new += [ps[-1]]
    ps = [p for p in ps_new] i range(n) range n X = len(ps) X len(ps) len ps ps_new = [] ps_new [] for i in range(X-1):
        ps_new.extend(new_koch(ps[i],ps[i+1]))
     i range(X-1) range X-1 X 1 ps_new.extend(new_koch(ps[i],ps[i+1])) ps_new.extend ps_new extend new_koch(ps[i],ps[i+1]) new_koch ps[i] ps i ps[i+1] ps i+1 i 1 ps_new += [ps[-1]] ps_new [ps[-1]] ps[-1] ps -1 p for p in ps_new for p in ps_new p ps_new for p in ps_new p ps = [p for p in ps_new] ps [p for p in ps_new] for p in ps:
    print(*p) p ps print(*p) print *p p n = int(input()) int(input()) n def diff(p1,p2):
    return [(p1[0]-p2[0])/3.0,(p1[1]-p2[1])/3.0] def diff(p1,p2):
    return [(p1[0]-p2[0])/3.0,(p1[1]-p2[1])/3.0] diff ps_new = [] [] ps_new p1 = [0,0] [0,0] p1 X = len(ps) len(ps) X def new_koch(p1,p2):
    p = diff(p2,p1)
    p_new1 = sumV(p1,p)
    p_new2 = sumV(p_new1,dot(R,p))
    p_new3 = sumV(p1,sumV(p,p))
    return [p1,p_new1,p_new2,p_new3] def new_koch(p1,p2):
    p = diff(p2,p1)
    p_new1 = sumV(p1,p)
    p_new2 = sumV(p_new1,dot(R,p))
    p_new3 = sumV(p1,sumV(p,p))
    return [p1,p_new1,p_new2,p_new3] new_koch ps_new += [ps[-1]] [ps[-1]] ps_new R = [[0.5,-1.7320508/2],[1.7320508/2,0.5]] [[0.5,-1.7320508/2],[1.7320508/2,0.5]] R def dot(A,b):
    vs = [0,0]
    for i in range(2):
        for j in range(2):
            vs[i] += A[i][j]*b[j]
    return vs def dot(A,b):
    vs = [0,0]
    for i in range(2):
        for j in range(2):
            vs[i] += A[i][j]*b[j]
    return vs dot ps = [p for p in ps_new] [p for p in ps_new] ps def sumV(p1,p2):
    return [p1[0]+p2[0],p1[1]+p2[1]] def sumV(p1,p2):
    return [p1[0]+p2[0],p1[1]+p2[1]] sumV p2 = [100,0] [100,0] p2 ps = [p1,p2] [p1,p2] ps

p1 = [0,0]
p2 = [100,0]
R = [[0.5,-1.7320508/2],[1.7320508/2,0.5]]

def dot(A,b):
    vs = [0,0]
    for i in range(2):
        for j in range(2):
            vs[i] += A[i][j]*b[j]
    return vs

def diff(p1,p2):
    return [(p1[0]-p2[0])/3.0,(p1[1]-p2[1])/3.0]

def sumV(p1,p2):
    return [p1[0]+p2[0],p1[1]+p2[1]]

def new_koch(p1,p2):
    p = diff(p2,p1)
    p_new1 = sumV(p1,p)
    p_new2 = sumV(p_new1,dot(R,p))
    p_new3 = sumV(p1,sumV(p,p))
    return [p1,p_new1,p_new2,p_new3]

n = int(input())
ps = [p1,p2]
for i in range(n):    
    X = len(ps)
    ps_new = []
    for i in range(X-1):
        ps_new.extend(new_koch(ps[i],ps[i+1]))
    ps_new += [ps[-1]]
    ps = [p for p in ps_new]

for p in ps:
    print(*p)


