import math
n = int(input())

class point:
    x = 0
    y = 0

def kock(k, p1, p2):
    s = point()
    t = point()
    u = point()
    if k == 0:
        return
    s.x = (2*p1.x+p2.x)/3
    s.y = (2*p1.y+p2.y)/3
    t.x = (p1.x+2*p2.x)/3
    t.y = (p1.y+2*p2.y)/3
    u.x = (t.x-s.x)*math.cos(math.radians(60))-(t.y-s.y)*math.sin(math.radians(60))+s.x
    u.y = (t.x-s.x)*math.sin(math.radians(60))+(t.y-s.y)*math.cos(math.radians(60))+s.y
    kock(k-1, p1, s)
    print(s.x, s.y)
    kock(k-1, s, u)
    print(u.x, u.y)
    kock(k-1, u, t)
    print(t.x, t.y)
    kock(k-1, t, p2)


a = point()
b = point()
b.x = 100
print(a.x, a.y)
kock(n, a, b)
print(b.x, b.y) import math math n = int(input()) n int(input()) int input() input class point:
    x = 0
    y = 0 point x = 0 x 0 y = 0 y 0 def kock(k, p1, p2):
    s = point()
    t = point()
    u = point()
    if k == 0:
        return
    s.x = (2*p1.x+p2.x)/3
    s.y = (2*p1.y+p2.y)/3
    t.x = (p1.x+2*p2.x)/3
    t.y = (p1.y+2*p2.y)/3
    u.x = (t.x-s.x)*math.cos(math.radians(60))-(t.y-s.y)*math.sin(math.radians(60))+s.x
    u.y = (t.x-s.x)*math.sin(math.radians(60))+(t.y-s.y)*math.cos(math.radians(60))+s.y
    kock(k-1, p1, s)
    print(s.x, s.y)
    kock(k-1, s, u)
    print(u.x, u.y)
    kock(k-1, u, t)
    print(t.x, t.y)
    kock(k-1, t, p2) kock s = point() s point() point t = point() t point() point u = point() u point() point if k == 0:
        return
     k == 0 k 0 return s.x = (2*p1.x+p2.x)/3 s.x s x (2*p1.x+p2.x)/3 2*p1.x+p2.x 2*p1.x 2 p1.x p1 x p2.x p2 x 3 s.y = (2*p1.y+p2.y)/3 s.y s y (2*p1.y+p2.y)/3 2*p1.y+p2.y 2*p1.y 2 p1.y p1 y p2.y p2 y 3 t.x = (p1.x+2*p2.x)/3 t.x t x (p1.x+2*p2.x)/3 p1.x+2*p2.x p1.x p1 x 2*p2.x 2 p2.x p2 x 3 t.y = (p1.y+2*p2.y)/3 t.y t y (p1.y+2*p2.y)/3 p1.y+2*p2.y p1.y p1 y 2*p2.y 2 p2.y p2 y 3 u.x = (t.x-s.x)*math.cos(math.radians(60))-(t.y-s.y)*math.sin(math.radians(60))+s.x u.x u x (t.x-s.x)*math.cos(math.radians(60))-(t.y-s.y)*math.sin(math.radians(60))+s.x (t.x-s.x)*math.cos(math.radians(60))-(t.y-s.y)*math.sin(math.radians(60)) (t.x-s.x)*math.cos(math.radians(60)) t.x-s.x t.x t x s.x s x math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 (t.y-s.y)*math.sin(math.radians(60)) t.y-s.y t.y t y s.y s y math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 s.x s x u.y = (t.x-s.x)*math.sin(math.radians(60))+(t.y-s.y)*math.cos(math.radians(60))+s.y u.y u y (t.x-s.x)*math.sin(math.radians(60))+(t.y-s.y)*math.cos(math.radians(60))+s.y (t.x-s.x)*math.sin(math.radians(60))+(t.y-s.y)*math.cos(math.radians(60)) (t.x-s.x)*math.sin(math.radians(60)) t.x-s.x t.x t x s.x s x math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 (t.y-s.y)*math.cos(math.radians(60)) t.y-s.y t.y t y s.y s y math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 s.y s y kock(k-1, p1, s) kock k-1 k 1 p1 s print(s.x, s.y) print s.x s x s.y s y kock(k-1, s, u) kock k-1 k 1 s u print(u.x, u.y) print u.x u x u.y u y kock(k-1, u, t) kock k-1 k 1 u t print(t.x, t.y) print t.x t x t.y t y kock(k-1, t, p2) kock k-1 k 1 t p2 k k p1 p1 p2 p2 a = point() a point() point b = point() b point() point b.x = 100 b.x b x 100 print(a.x, a.y) print a.x a x a.y a y kock(n, a, b) kock n a b print(b.x, b.y) print b.x b x b.y b y n = int(input()) int(input()) n a = point() point() a def kock(k, p1, p2):
    s = point()
    t = point()
    u = point()
    if k == 0:
        return
    s.x = (2*p1.x+p2.x)/3
    s.y = (2*p1.y+p2.y)/3
    t.x = (p1.x+2*p2.x)/3
    t.y = (p1.y+2*p2.y)/3
    u.x = (t.x-s.x)*math.cos(math.radians(60))-(t.y-s.y)*math.sin(math.radians(60))+s.x
    u.y = (t.x-s.x)*math.sin(math.radians(60))+(t.y-s.y)*math.cos(math.radians(60))+s.y
    kock(k-1, p1, s)
    print(s.x, s.y)
    kock(k-1, s, u)
    print(u.x, u.y)
    kock(k-1, u, t)
    print(t.x, t.y)
    kock(k-1, t, p2) def kock(k, p1, p2):
    s = point()
    t = point()
    u = point()
    if k == 0:
        return
    s.x = (2*p1.x+p2.x)/3
    s.y = (2*p1.y+p2.y)/3
    t.x = (p1.x+2*p2.x)/3
    t.y = (p1.y+2*p2.y)/3
    u.x = (t.x-s.x)*math.cos(math.radians(60))-(t.y-s.y)*math.sin(math.radians(60))+s.x
    u.y = (t.x-s.x)*math.sin(math.radians(60))+(t.y-s.y)*math.cos(math.radians(60))+s.y
    kock(k-1, p1, s)
    print(s.x, s.y)
    kock(k-1, s, u)
    print(u.x, u.y)
    kock(k-1, u, t)
    print(t.x, t.y)
    kock(k-1, t, p2) kock b = point() point() b class point:
    x = 0
    y = 0 class point:
    x = 0
    y = 0 point
import math
n = int(input())

class point:
    x = 0
    y = 0

def kock(k, p1, p2):
    s = point()
    t = point()
    u = point()
    if k == 0:
        return
    s.x = (2*p1.x+p2.x)/3
    s.y = (2*p1.y+p2.y)/3
    t.x = (p1.x+2*p2.x)/3
    t.y = (p1.y+2*p2.y)/3
    u.x = (t.x-s.x)*math.cos(math.radians(60))-(t.y-s.y)*math.sin(math.radians(60))+s.x
    u.y = (t.x-s.x)*math.sin(math.radians(60))+(t.y-s.y)*math.cos(math.radians(60))+s.y
    kock(k-1, p1, s)
    print(s.x, s.y)
    kock(k-1, s, u)
    print(u.x, u.y)
    kock(k-1, u, t)
    print(t.x, t.y)
    kock(k-1, t, p2)


a = point()
b = point()
b.x = 100
print(a.x, a.y)
kock(n, a, b)
print(b.x, b.y)
