import math

n = int(raw_input())

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

th = math.pi/3.0

def koch(n, p1, p2):
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()

    s.x = (2*p1.x + 1*p2.x) / 3.0
    s.y = (2*p1.y + 1*p2.y) / 3.0
    t.x = (1*p1.x + 2*p2.x) / 3.0
    t.y = (1*p1.y + 2*p2.y) / 3.0
    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,p1,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,p2)
    
def main():
    p1 = Point()
    p2 = Point()

    p1.x = 0.0
    p1.y = 0.0
    p2.x = 100.0
    p2.y = 0.0

    print p1.x, p1.y
    koch(n,p1,p2)
    print p2.x, p2.y

    return 0

main() import math math n = int(raw_input()) n int(raw_input()) int raw_input() raw_input 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 th = math.pi/3.0 th math.pi/3.0 math.pi math pi 3.0 def koch(n, p1, p2):
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()

    s.x = (2*p1.x + 1*p2.x) / 3.0
    s.y = (2*p1.y + 1*p2.y) / 3.0
    t.x = (1*p1.x + 2*p2.x) / 3.0
    t.y = (1*p1.y + 2*p2.y) / 3.0
    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,p1,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,p2)
     koch 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*p1.x + 1*p2.x) / 3.0 s.x s x (2*p1.x + 1*p2.x) / 3.0 2*p1.x + 1*p2.x 2*p1.x 2 p1.x p1 x 1*p2.x 1 p2.x p2 x 3.0 s.y = (2*p1.y + 1*p2.y) / 3.0 s.y s y (2*p1.y + 1*p2.y) / 3.0 2*p1.y + 1*p2.y 2*p1.y 2 p1.y p1 y 1*p2.y 1 p2.y p2 y 3.0 t.x = (1*p1.x + 2*p2.x) / 3.0 t.x t x (1*p1.x + 2*p2.x) / 3.0 1*p1.x + 2*p2.x 1*p1.x 1 p1.x p1 x 2*p2.x 2 p2.x p2 x 3.0 t.y = (1*p1.y + 2*p2.y) / 3.0 t.y t y (1*p1.y + 2*p2.y) / 3.0 1*p1.y + 2*p2.y 1*p1.y 1 p1.y p1 y 2*p2.y 2 p2.y p2 y 3.0 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,p1,s) koch n-1 n 1 p1 s 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 x u.y u y koch(n-1,u,t) koch n-1 n 1 u t print t.x t x t.y t y koch(n-1,t,p2) koch n-1 n 1 t p2 n n p1 p1 p2 p2 def main():
    p1 = Point()
    p2 = Point()

    p1.x = 0.0
    p1.y = 0.0
    p2.x = 100.0
    p2.y = 0.0

    print p1.x, p1.y
    koch(n,p1,p2)
    print p2.x, p2.y

    return 0 main p1 = Point() p1 Point() Point p2 = Point() p2 Point() Point p1.x = 0.0 p1.x p1 x 0.0 p1.y = 0.0 p1.y p1 y 0.0 p2.x = 100.0 p2.x p2 x 100.0 p2.y = 0.0 p2.y p2 y 0.0 print p1.x p1 x p1.y p1 y koch(n,p1,p2) koch n p1 p2 print p2.x p2 x p2.y p2 y return 0 0 main() main def koch(n, p1, p2):
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()

    s.x = (2*p1.x + 1*p2.x) / 3.0
    s.y = (2*p1.y + 1*p2.y) / 3.0
    t.x = (1*p1.x + 2*p2.x) / 3.0
    t.y = (1*p1.y + 2*p2.y) / 3.0
    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,p1,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,p2)
     def koch(n, p1, p2):
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()

    s.x = (2*p1.x + 1*p2.x) / 3.0
    s.y = (2*p1.y + 1*p2.y) / 3.0
    t.x = (1*p1.x + 2*p2.x) / 3.0
    t.y = (1*p1.y + 2*p2.y) / 3.0
    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,p1,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,p2)
     koch def main():
    p1 = Point()
    p2 = Point()

    p1.x = 0.0
    p1.y = 0.0
    p2.x = 100.0
    p2.y = 0.0

    print p1.x, p1.y
    koch(n,p1,p2)
    print p2.x, p2.y

    return 0 def main():
    p1 = Point()
    p2 = Point()

    p1.x = 0.0
    p1.y = 0.0
    p2.x = 100.0
    p2.y = 0.0

    print p1.x, p1.y
    koch(n,p1,p2)
    print p2.x, p2.y

    return 0 main th = math.pi/3.0 math.pi/3.0 th n = int(raw_input()) int(raw_input()) n class Point:
    def __init__(self):
        self.x = 0
        self.y = 0 class Point:
    def __init__(self):
        self.x = 0
        self.y = 0 Point
import math

n = int(raw_input())

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

th = math.pi/3.0

def koch(n, p1, p2):
    if n == 0:
        return
    s = Point()
    t = Point()
    u = Point()

    s.x = (2*p1.x + 1*p2.x) / 3.0
    s.y = (2*p1.y + 1*p2.y) / 3.0
    t.x = (1*p1.x + 2*p2.x) / 3.0
    t.y = (1*p1.y + 2*p2.y) / 3.0
    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,p1,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,p2)
    
def main():
    p1 = Point()
    p2 = Point()

    p1.x = 0.0
    p1.y = 0.0
    p2.x = 100.0
    p2.y = 0.0

    print p1.x, p1.y
    koch(n,p1,p2)
    print p2.x, p2.y

    return 0

main()