import math
import sys
class Point:
    def __init__(self):
        self.x = 0
        self.y = 0

def koch(n,a,b):
    th = math.pi*(60.0/180.0)
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()
    s.x = (2.0*a.x + 1.0*b.x)/3
    s.y = (2.0*a.y + 1.0*b.y)/3
    t.x = (1.0*a.x + 2.0*b.x)/3
    t.y = (1.0*a.y + 2.0*b.y)/3
    u.x = (t.x-s.x)*math.cos(th) - (t.y - s.y)*math.sin(th) + s.x
    u.y = (t.x-s.x)*math.sin(th) + (t.y - s.y)*math.cos(th) + s.y
    koch(n-1,a,s)
    print(s.x,s.y)
    koch(n-1,s,u)
    print(u.x,u.y)
    koch(n-1,u,t)
    print(t.x,t.y)
    koch(n-1,t,b)

if __name__ == "__main__":
    n = int(input())
    a = Point()
    b = Point()
    a.x = 0
    a.y = 0
    b.x = 100
    b.y = 0

    print(a.x,a.y)
    koch(n,a,b)
    print(b.x,b.y)


     import math math import sys sys class Point:
    def __init__(self):
        self.x = 0
        self.y = 0 Point def __init__(self):
        self.x = 0
        self.y = 0 __init__ self.x = 0 self.x self x 0 self.y = 0 self.y self y 0 self self def koch(n,a,b):
    th = math.pi*(60.0/180.0)
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()
    s.x = (2.0*a.x + 1.0*b.x)/3
    s.y = (2.0*a.y + 1.0*b.y)/3
    t.x = (1.0*a.x + 2.0*b.x)/3
    t.y = (1.0*a.y + 2.0*b.y)/3
    u.x = (t.x-s.x)*math.cos(th) - (t.y - s.y)*math.sin(th) + s.x
    u.y = (t.x-s.x)*math.sin(th) + (t.y - s.y)*math.cos(th) + s.y
    koch(n-1,a,s)
    print(s.x,s.y)
    koch(n-1,s,u)
    print(u.x,u.y)
    koch(n-1,u,t)
    print(t.x,t.y)
    koch(n-1,t,b) koch th = math.pi*(60.0/180.0) th math.pi*(60.0/180.0) math.pi math pi 60.0/180.0 60.0 180.0 if n == 0:
        return
     n == 0 n 0 return s = Point() s Point() Point t = Point() t Point() Point u = Point() u Point() Point s.x = (2.0*a.x + 1.0*b.x)/3 s.x s x (2.0*a.x + 1.0*b.x)/3 2.0*a.x + 1.0*b.x 2.0*a.x 2.0 a.x a x 1.0*b.x 1.0 b.x b x 3 s.y = (2.0*a.y + 1.0*b.y)/3 s.y s y (2.0*a.y + 1.0*b.y)/3 2.0*a.y + 1.0*b.y 2.0*a.y 2.0 a.y a y 1.0*b.y 1.0 b.y b y 3 t.x = (1.0*a.x + 2.0*b.x)/3 t.x t x (1.0*a.x + 2.0*b.x)/3 1.0*a.x + 2.0*b.x 1.0*a.x 1.0 a.x a x 2.0*b.x 2.0 b.x b x 3 t.y = (1.0*a.y + 2.0*b.y)/3 t.y t y (1.0*a.y + 2.0*b.y)/3 1.0*a.y + 2.0*b.y 1.0*a.y 1.0 a.y a y 2.0*b.y 2.0 b.y b y 3 u.x = (t.x-s.x)*math.cos(th) - (t.y - s.y)*math.sin(th) + s.x u.x u x (t.x-s.x)*math.cos(th) - (t.y - s.y)*math.sin(th) + s.x (t.x-s.x)*math.cos(th) - (t.y - s.y)*math.sin(th) (t.x-s.x)*math.cos(th) t.x-s.x t.x t x s.x s x math.cos(th) math.cos math cos th (t.y - s.y)*math.sin(th) t.y - s.y t.y t y s.y s y math.sin(th) math.sin math sin th s.x s x u.y = (t.x-s.x)*math.sin(th) + (t.y - s.y)*math.cos(th) + s.y u.y u y (t.x-s.x)*math.sin(th) + (t.y - s.y)*math.cos(th) + s.y (t.x-s.x)*math.sin(th) + (t.y - s.y)*math.cos(th) (t.x-s.x)*math.sin(th) t.x-s.x t.x t x s.x s x math.sin(th) math.sin math sin th (t.y - s.y)*math.cos(th) t.y - s.y t.y t y s.y s y math.cos(th) math.cos math cos th s.y s y koch(n-1,a,s) koch n-1 n 1 a s print(s.x,s.y) print s.x s x s.y s y koch(n-1,s,u) koch n-1 n 1 s u print(u.x,u.y) print u.x u x u.y u y koch(n-1,u,t) koch n-1 n 1 u t print(t.x,t.y) print t.x t x t.y t y koch(n-1,t,b) koch n-1 n 1 t b n n a a b b if __name__ == "__main__":
    n = int(input())
    a = Point()
    b = Point()
    a.x = 0
    a.y = 0
    b.x = 100
    b.y = 0

    print(a.x,a.y)
    koch(n,a,b)
    print(b.x,b.y)


     __name__ == "__main__" __name__ "__main__" n = int(input()) n int(input()) int input() input a = Point() a Point() Point b = Point() b Point() Point a.x = 0 a.x a x 0 a.y = 0 a.y a y 0 b.x = 100 b.x b x 100 b.y = 0 b.y b y 0 print(a.x,a.y) print a.x a x a.y a y koch(n,a,b) koch n a b print(b.x,b.y) print b.x b x b.y b y class Point:
    def __init__(self):
        self.x = 0
        self.y = 0 class Point:
    def __init__(self):
        self.x = 0
        self.y = 0 Point n = int(input()) int(input()) n def koch(n,a,b):
    th = math.pi*(60.0/180.0)
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()
    s.x = (2.0*a.x + 1.0*b.x)/3
    s.y = (2.0*a.y + 1.0*b.y)/3
    t.x = (1.0*a.x + 2.0*b.x)/3
    t.y = (1.0*a.y + 2.0*b.y)/3
    u.x = (t.x-s.x)*math.cos(th) - (t.y - s.y)*math.sin(th) + s.x
    u.y = (t.x-s.x)*math.sin(th) + (t.y - s.y)*math.cos(th) + s.y
    koch(n-1,a,s)
    print(s.x,s.y)
    koch(n-1,s,u)
    print(u.x,u.y)
    koch(n-1,u,t)
    print(t.x,t.y)
    koch(n-1,t,b) def koch(n,a,b):
    th = math.pi*(60.0/180.0)
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()
    s.x = (2.0*a.x + 1.0*b.x)/3
    s.y = (2.0*a.y + 1.0*b.y)/3
    t.x = (1.0*a.x + 2.0*b.x)/3
    t.y = (1.0*a.y + 2.0*b.y)/3
    u.x = (t.x-s.x)*math.cos(th) - (t.y - s.y)*math.sin(th) + s.x
    u.y = (t.x-s.x)*math.sin(th) + (t.y - s.y)*math.cos(th) + s.y
    koch(n-1,a,s)
    print(s.x,s.y)
    koch(n-1,s,u)
    print(u.x,u.y)
    koch(n-1,u,t)
    print(t.x,t.y)
    koch(n-1,t,b) koch a = Point() Point() a b = Point() Point() b
import math
import sys
class Point:
    def __init__(self):
        self.x = 0
        self.y = 0

def koch(n,a,b):
    th = math.pi*(60.0/180.0)
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()
    s.x = (2.0*a.x + 1.0*b.x)/3
    s.y = (2.0*a.y + 1.0*b.y)/3
    t.x = (1.0*a.x + 2.0*b.x)/3
    t.y = (1.0*a.y + 2.0*b.y)/3
    u.x = (t.x-s.x)*math.cos(th) - (t.y - s.y)*math.sin(th) + s.x
    u.y = (t.x-s.x)*math.sin(th) + (t.y - s.y)*math.cos(th) + s.y
    koch(n-1,a,s)
    print(s.x,s.y)
    koch(n-1,s,u)
    print(u.x,u.y)
    koch(n-1,u,t)
    print(t.x,t.y)
    koch(n-1,t,b)

if __name__ == "__main__":
    n = int(input())
    a = Point()
    b = Point()
    a.x = 0
    a.y = 0
    b.x = 100
    b.y = 0

    print(a.x,a.y)
    koch(n,a,b)
    print(b.x,b.y)


    
