import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**10
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    n = I()

    def rec(depth, p0_x, p0_y, p1_x, p1_y):
        if depth!=n:
            p2_x = p0_x*2/3 + p1_x*1/3
            p2_y = p0_y*2/3 + p1_y*1/3
            p4_x = p0_x*1/3 + p1_x*2/3
            p4_y = p0_y*1/3 + p1_y*2/3
            p3_x = (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x
            p3_y = (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y

            rec(depth+1, p0_x, p0_y, p2_x, p2_y)
            print(p2_x, p2_y)
            rec(depth+1, p2_x, p2_y, p3_x, p3_y)
            print(p3_x, p3_y)
            rec(depth+1, p3_x, p3_y, p4_x, p4_y)
            print(p4_x, p4_y)
            rec(depth+1, p4_x, p4_y, p1_x, p1_y)
    
    print(0, 0)
    rec(0, 0, 0, 100, 0)
    print(100, 0)

if __name__ == '__main__':
    resolve() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 INF = 10**10 INF 10**10 10 10 def I(): return int(input()) I def F(): return float(input()) F def SS(): return input() SS int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x def LI(): return [int(x) for x in input().split()] LI int(x)-1 for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x)-1 int(x) int x 1 def LI_(): return [int(x)-1 for x in input().split()] LI_ float(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() float(x) float x def LF(): return [float(x) for x in input().split()] LF def LSS(): return input().split() LSS def resolve():
    n = I()

    def rec(depth, p0_x, p0_y, p1_x, p1_y):
        if depth!=n:
            p2_x = p0_x*2/3 + p1_x*1/3
            p2_y = p0_y*2/3 + p1_y*1/3
            p4_x = p0_x*1/3 + p1_x*2/3
            p4_y = p0_y*1/3 + p1_y*2/3
            p3_x = (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x
            p3_y = (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y

            rec(depth+1, p0_x, p0_y, p2_x, p2_y)
            print(p2_x, p2_y)
            rec(depth+1, p2_x, p2_y, p3_x, p3_y)
            print(p3_x, p3_y)
            rec(depth+1, p3_x, p3_y, p4_x, p4_y)
            print(p4_x, p4_y)
            rec(depth+1, p4_x, p4_y, p1_x, p1_y)
    
    print(0, 0)
    rec(0, 0, 0, 100, 0)
    print(100, 0) resolve n = I() n I() I def rec(depth, p0_x, p0_y, p1_x, p1_y):
        if depth!=n:
            p2_x = p0_x*2/3 + p1_x*1/3
            p2_y = p0_y*2/3 + p1_y*1/3
            p4_x = p0_x*1/3 + p1_x*2/3
            p4_y = p0_y*1/3 + p1_y*2/3
            p3_x = (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x
            p3_y = (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y

            rec(depth+1, p0_x, p0_y, p2_x, p2_y)
            print(p2_x, p2_y)
            rec(depth+1, p2_x, p2_y, p3_x, p3_y)
            print(p3_x, p3_y)
            rec(depth+1, p3_x, p3_y, p4_x, p4_y)
            print(p4_x, p4_y)
            rec(depth+1, p4_x, p4_y, p1_x, p1_y)
    
     rec if depth!=n:
            p2_x = p0_x*2/3 + p1_x*1/3
            p2_y = p0_y*2/3 + p1_y*1/3
            p4_x = p0_x*1/3 + p1_x*2/3
            p4_y = p0_y*1/3 + p1_y*2/3
            p3_x = (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x
            p3_y = (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y

            rec(depth+1, p0_x, p0_y, p2_x, p2_y)
            print(p2_x, p2_y)
            rec(depth+1, p2_x, p2_y, p3_x, p3_y)
            print(p3_x, p3_y)
            rec(depth+1, p3_x, p3_y, p4_x, p4_y)
            print(p4_x, p4_y)
            rec(depth+1, p4_x, p4_y, p1_x, p1_y)
    
     depth!=n depth n p2_x = p0_x*2/3 + p1_x*1/3 p2_x p0_x*2/3 + p1_x*1/3 p0_x*2/3 p0_x*2 p0_x 2 3 p1_x*1/3 p1_x*1 p1_x 1 3 p2_y = p0_y*2/3 + p1_y*1/3 p2_y p0_y*2/3 + p1_y*1/3 p0_y*2/3 p0_y*2 p0_y 2 3 p1_y*1/3 p1_y*1 p1_y 1 3 p4_x = p0_x*1/3 + p1_x*2/3 p4_x p0_x*1/3 + p1_x*2/3 p0_x*1/3 p0_x*1 p0_x 1 3 p1_x*2/3 p1_x*2 p1_x 2 3 p4_y = p0_y*1/3 + p1_y*2/3 p4_y p0_y*1/3 + p1_y*2/3 p0_y*1/3 p0_y*1 p0_y 1 3 p1_y*2/3 p1_y*2 p1_y 2 3 p3_x = (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x p3_x (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y) (1/2)*(p4_x-p2_x) 1/2 1 2 p4_x-p2_x p4_x p2_x (3**0.5/2)*(p4_y-p2_y) 3**0.5/2 3**0.5 3 0.5 2 p4_y-p2_y p4_y p2_y p2_x p3_y = (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y p3_y (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y) (3**0.5/2)*(p4_x-p2_x) 3**0.5/2 3**0.5 3 0.5 2 p4_x-p2_x p4_x p2_x (1/2)*(p4_y-p2_y) 1/2 1 2 p4_y-p2_y p4_y p2_y p2_y rec(depth+1, p0_x, p0_y, p2_x, p2_y) rec depth+1 depth 1 p0_x p0_y p2_x p2_y print(p2_x, p2_y) print p2_x p2_y rec(depth+1, p2_x, p2_y, p3_x, p3_y) rec depth+1 depth 1 p2_x p2_y p3_x p3_y print(p3_x, p3_y) print p3_x p3_y rec(depth+1, p3_x, p3_y, p4_x, p4_y) rec depth+1 depth 1 p3_x p3_y p4_x p4_y print(p4_x, p4_y) print p4_x p4_y rec(depth+1, p4_x, p4_y, p1_x, p1_y) rec depth+1 depth 1 p4_x p4_y p1_x p1_y depth depth p0_x p0_x p0_y p0_y p1_x p1_x p1_y p1_y print(0, 0) print 0 0 rec(0, 0, 0, 100, 0) rec 0 0 0 100 0 print(100, 0) print 100 0 if __name__ == '__main__':
    resolve() __name__ == '__main__' __name__ '__main__' resolve() resolve def F(): return float(input()) def F(): return float(input()) F def LI_(): return [int(x)-1 for x in input().split()] def LI_(): return [int(x)-1 for x in input().split()] LI_ def LSS(): return input().split() def LSS(): return input().split() LSS def LI(): return [int(x) for x in input().split()] def LI(): return [int(x) for x in input().split()] LI def SS(): return input() def SS(): return input() SS input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input def LF(): return [float(x) for x in input().split()] def LF(): return [float(x) for x in input().split()] LF def resolve():
    n = I()

    def rec(depth, p0_x, p0_y, p1_x, p1_y):
        if depth!=n:
            p2_x = p0_x*2/3 + p1_x*1/3
            p2_y = p0_y*2/3 + p1_y*1/3
            p4_x = p0_x*1/3 + p1_x*2/3
            p4_y = p0_y*1/3 + p1_y*2/3
            p3_x = (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x
            p3_y = (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y

            rec(depth+1, p0_x, p0_y, p2_x, p2_y)
            print(p2_x, p2_y)
            rec(depth+1, p2_x, p2_y, p3_x, p3_y)
            print(p3_x, p3_y)
            rec(depth+1, p3_x, p3_y, p4_x, p4_y)
            print(p4_x, p4_y)
            rec(depth+1, p4_x, p4_y, p1_x, p1_y)
    
    print(0, 0)
    rec(0, 0, 0, 100, 0)
    print(100, 0) def resolve():
    n = I()

    def rec(depth, p0_x, p0_y, p1_x, p1_y):
        if depth!=n:
            p2_x = p0_x*2/3 + p1_x*1/3
            p2_y = p0_y*2/3 + p1_y*1/3
            p4_x = p0_x*1/3 + p1_x*2/3
            p4_y = p0_y*1/3 + p1_y*2/3
            p3_x = (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x
            p3_y = (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y

            rec(depth+1, p0_x, p0_y, p2_x, p2_y)
            print(p2_x, p2_y)
            rec(depth+1, p2_x, p2_y, p3_x, p3_y)
            print(p3_x, p3_y)
            rec(depth+1, p3_x, p3_y, p4_x, p4_y)
            print(p4_x, p4_y)
            rec(depth+1, p4_x, p4_y, p1_x, p1_y)
    
    print(0, 0)
    rec(0, 0, 0, 100, 0)
    print(100, 0) resolve INF = 10**10 10**10 INF def I(): return int(input()) def I(): return int(input()) I
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**10
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    n = I()

    def rec(depth, p0_x, p0_y, p1_x, p1_y):
        if depth!=n:
            p2_x = p0_x*2/3 + p1_x*1/3
            p2_y = p0_y*2/3 + p1_y*1/3
            p4_x = p0_x*1/3 + p1_x*2/3
            p4_y = p0_y*1/3 + p1_y*2/3
            p3_x = (1/2)*(p4_x-p2_x)-(3**0.5/2)*(p4_y-p2_y)+p2_x
            p3_y = (3**0.5/2)*(p4_x-p2_x)+(1/2)*(p4_y-p2_y)+p2_y

            rec(depth+1, p0_x, p0_y, p2_x, p2_y)
            print(p2_x, p2_y)
            rec(depth+1, p2_x, p2_y, p3_x, p3_y)
            print(p3_x, p3_y)
            rec(depth+1, p3_x, p3_y, p4_x, p4_y)
            print(p4_x, p4_y)
            rec(depth+1, p4_x, p4_y, p1_x, p1_y)
    
    print(0, 0)
    rec(0, 0, 0, 100, 0)
    print(100, 0)

if __name__ == '__main__':
    resolve()
