from math import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def div3(a,b):
    c1=(2*a+b)/3
    c2=(a+2*b)/3
    return [c1,c2]

def main():
    n=int(input())
    xy=[[0,0],[100,0]]
    #aa=list(map(int, input().split()))
    for _ in range(n):
        nxy=[[0,0]]
        for [x0,y0],[x4,y4] in zip(xy,xy[1:]):
            x1,x3=div3(x0,x4)
            y1,y3=div3(y0,y4)
            a=((x3-x1)**2+(y3-y1)**2)**0.5
            rad=atan2(y3-y1,x3-x1)
            x2=x1+a*cos(rad+pi/3)
            y2=y1+a*sin(rad+pi/3)
            nxy+=[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
        xy=nxy
    for x,y in xy:
        print(x,y)

main()
 from math import * import sys sys sys.setrecursionlimit(10 ** 6) sys.setrecursionlimit sys setrecursionlimit 10 ** 6 10 6 int1 = lambda x: int(x) - 1 int1 lambda x: int(x) - 1 int(x) - 1 int(x) int x 1 x p2D = lambda x: print(*x, sep="\n") p2D lambda x: print(*x, sep="\n") print(*x, sep="\n") print *x x sep="\n" sep "\n" x def div3(a,b):
    c1=(2*a+b)/3
    c2=(a+2*b)/3
    return [c1,c2] div3 c1=(2*a+b)/3 c1 (2*a+b)/3 2*a+b 2*a 2 a b 3 c2=(a+2*b)/3 c2 (a+2*b)/3 a+2*b a 2*b 2 b 3 return [c1,c2] [c1,c2] c1 c2 a a b b def main():
    n=int(input())
    xy=[[0,0],[100,0]]
    #aa=list(map(int, input().split()))
    for _ in range(n):
        nxy=[[0,0]]
        for [x0,y0],[x4,y4] in zip(xy,xy[1:]):
            x1,x3=div3(x0,x4)
            y1,y3=div3(y0,y4)
            a=((x3-x1)**2+(y3-y1)**2)**0.5
            rad=atan2(y3-y1,x3-x1)
            x2=x1+a*cos(rad+pi/3)
            y2=y1+a*sin(rad+pi/3)
            nxy+=[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
        xy=nxy
    for x,y in xy:
        print(x,y) main n=int(input()) n int(input()) int input() input xy=[[0,0],[100,0]] xy [[0,0],[100,0]] [0,0] 0 0 [100,0] 100 0 for _ in range(n):
        nxy=[[0,0]]
        for [x0,y0],[x4,y4] in zip(xy,xy[1:]):
            x1,x3=div3(x0,x4)
            y1,y3=div3(y0,y4)
            a=((x3-x1)**2+(y3-y1)**2)**0.5
            rad=atan2(y3-y1,x3-x1)
            x2=x1+a*cos(rad+pi/3)
            y2=y1+a*sin(rad+pi/3)
            nxy+=[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
        xy=nxy
     _ range(n) range n nxy=[[0,0]] nxy [[0,0]] [0,0] 0 0 for [x0,y0],[x4,y4] in zip(xy,xy[1:]):
            x1,x3=div3(x0,x4)
            y1,y3=div3(y0,y4)
            a=((x3-x1)**2+(y3-y1)**2)**0.5
            rad=atan2(y3-y1,x3-x1)
            x2=x1+a*cos(rad+pi/3)
            y2=y1+a*sin(rad+pi/3)
            nxy+=[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
         [x0,y0] x0 y0 [x4,y4] x4 y4 zip(xy,xy[1:]) zip xy xy[1:] xy 1: 1 x1,x3=div3(x0,x4) x1 div3(x0,x4) div3 x0 x4 x3 y1,y3=div3(y0,y4) y1 div3(y0,y4) div3 y0 y4 y3 a=((x3-x1)**2+(y3-y1)**2)**0.5 a ((x3-x1)**2+(y3-y1)**2)**0.5 (x3-x1)**2+(y3-y1)**2 (x3-x1)**2 x3-x1 x3 x1 2 (y3-y1)**2 y3-y1 y3 y1 2 0.5 rad=atan2(y3-y1,x3-x1) rad atan2(y3-y1,x3-x1) atan2 y3-y1 y3 y1 x3-x1 x3 x1 x2=x1+a*cos(rad+pi/3) x2 x1+a*cos(rad+pi/3) x1 a*cos(rad+pi/3) a cos(rad+pi/3) cos rad+pi/3 rad pi/3 pi 3 y2=y1+a*sin(rad+pi/3) y2 y1+a*sin(rad+pi/3) y1 a*sin(rad+pi/3) a sin(rad+pi/3) sin rad+pi/3 rad pi/3 pi 3 nxy+=[[x1,y1],[x2,y2],[x3,y3],[x4,y4]] nxy [[x1,y1],[x2,y2],[x3,y3],[x4,y4]] [x1,y1] x1 y1 [x2,y2] x2 y2 [x3,y3] x3 y3 [x4,y4] x4 y4 xy=nxy xy nxy for x,y in xy:
        print(x,y) x y xy print(x,y) print x y main() main def main():
    n=int(input())
    xy=[[0,0],[100,0]]
    #aa=list(map(int, input().split()))
    for _ in range(n):
        nxy=[[0,0]]
        for [x0,y0],[x4,y4] in zip(xy,xy[1:]):
            x1,x3=div3(x0,x4)
            y1,y3=div3(y0,y4)
            a=((x3-x1)**2+(y3-y1)**2)**0.5
            rad=atan2(y3-y1,x3-x1)
            x2=x1+a*cos(rad+pi/3)
            y2=y1+a*sin(rad+pi/3)
            nxy+=[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
        xy=nxy
    for x,y in xy:
        print(x,y) def main():
    n=int(input())
    xy=[[0,0],[100,0]]
    #aa=list(map(int, input().split()))
    for _ in range(n):
        nxy=[[0,0]]
        for [x0,y0],[x4,y4] in zip(xy,xy[1:]):
            x1,x3=div3(x0,x4)
            y1,y3=div3(y0,y4)
            a=((x3-x1)**2+(y3-y1)**2)**0.5
            rad=atan2(y3-y1,x3-x1)
            x2=x1+a*cos(rad+pi/3)
            y2=y1+a*sin(rad+pi/3)
            nxy+=[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
        xy=nxy
    for x,y in xy:
        print(x,y) main def div3(a,b):
    c1=(2*a+b)/3
    c2=(a+2*b)/3
    return [c1,c2] def div3(a,b):
    c1=(2*a+b)/3
    c2=(a+2*b)/3
    return [c1,c2] div3 int1 = lambda x: int(x) - 1 lambda x: int(x) - 1 int1 p2D = lambda x: print(*x, sep="\n") lambda x: print(*x, sep="\n") p2D
from math import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def div3(a,b):
    c1=(2*a+b)/3
    c2=(a+2*b)/3
    return [c1,c2]

def main():
    n=int(input())
    xy=[[0,0],[100,0]]
    #aa=list(map(int, input().split()))
    for _ in range(n):
        nxy=[[0,0]]
        for [x0,y0],[x4,y4] in zip(xy,xy[1:]):
            x1,x3=div3(x0,x4)
            y1,y3=div3(y0,y4)
            a=((x3-x1)**2+(y3-y1)**2)**0.5
            rad=atan2(y3-y1,x3-x1)
            x2=x1+a*cos(rad+pi/3)
            y2=y1+a*sin(rad+pi/3)
            nxy+=[[x1,y1],[x2,y2],[x3,y3],[x4,y4]]
        xy=nxy
    for x,y in xy:
        print(x,y)

main()

