# -*- coding: utf-8 -*-

import math

class Point_Class:
    def __init__(self, x, y):
        self.x  =   x
        self.y  =   y

    def printPoint(self):
        print "%f %f" %(self.x, self.y)

def koch(n, p1, p2):
    if n == 0:
        return
    sin60 = math.sin(math.radians(60))
    cos60 = math.cos(math.radians(60))
    s = Point_Class((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Point_Class((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    u = Point_Class((t.x-s.x)*cos60-(t.y-s.y)*sin60+s.x, (t.x-s.x)*sin60+(t.y-s.y)*cos60+s.y)
    koch(n-1, p1, s)
    s.printPoint()
    koch(n-1, s, u)
    u.printPoint()
    koch(n-1, u, t)
    t.printPoint()
    koch(n-1, t, p2)

n = int(raw_input())
p1 = Point_Class(0.0, 0.0)
p2 = Point_Class(100.0, 0.0)
p1.printPoint()
koch(n, p1, p2)
p2.printPoint() import math math class Point_Class:
    def __init__(self, x, y):
        self.x  =   x
        self.y  =   y

    def printPoint(self):
        print "%f %f" %(self.x, self.y) Point_Class def __init__(self, x, y):
        self.x  =   x
        self.y  =   y

     __init__ self.x  =   x self.x self x x self.y  =   y self.y self y y self self x x y y def printPoint(self):
        print "%f %f" %(self.x, self.y) printPoint print "%f %f" %(self.x, self.y) "%f %f" (self.x, self.y) self.x self x self.y self y self self def koch(n, p1, p2):
    if n == 0:
        return
    sin60 = math.sin(math.radians(60))
    cos60 = math.cos(math.radians(60))
    s = Point_Class((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Point_Class((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    u = Point_Class((t.x-s.x)*cos60-(t.y-s.y)*sin60+s.x, (t.x-s.x)*sin60+(t.y-s.y)*cos60+s.y)
    koch(n-1, p1, s)
    s.printPoint()
    koch(n-1, s, u)
    u.printPoint()
    koch(n-1, u, t)
    t.printPoint()
    koch(n-1, t, p2) koch if n == 0:
        return
     n == 0 n 0 return sin60 = math.sin(math.radians(60)) sin60 math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 cos60 = math.cos(math.radians(60)) cos60 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 s = Point_Class((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3) s Point_Class((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3) Point_Class (2*p1.x+p2.x)/3 2*p1.x+p2.x 2*p1.x 2 p1.x p1 x p2.x p2 x 3 (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 = Point_Class((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3) t Point_Class((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3) Point_Class (p1.x+2*p2.x)/3 p1.x+2*p2.x p1.x p1 x 2*p2.x 2 p2.x p2 x 3 (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 = Point_Class((t.x-s.x)*cos60-(t.y-s.y)*sin60+s.x, (t.x-s.x)*sin60+(t.y-s.y)*cos60+s.y) u Point_Class((t.x-s.x)*cos60-(t.y-s.y)*sin60+s.x, (t.x-s.x)*sin60+(t.y-s.y)*cos60+s.y) Point_Class (t.x-s.x)*cos60-(t.y-s.y)*sin60+s.x (t.x-s.x)*cos60-(t.y-s.y)*sin60 (t.x-s.x)*cos60 t.x-s.x t.x t x s.x s x cos60 (t.y-s.y)*sin60 t.y-s.y t.y t y s.y s y sin60 s.x s x (t.x-s.x)*sin60+(t.y-s.y)*cos60+s.y (t.x-s.x)*sin60+(t.y-s.y)*cos60 (t.x-s.x)*sin60 t.x-s.x t.x t x s.x s x sin60 (t.y-s.y)*cos60 t.y-s.y t.y t y s.y s y cos60 s.y s y koch(n-1, p1, s) koch n-1 n 1 p1 s s.printPoint() s.printPoint s printPoint koch(n-1, s, u) koch n-1 n 1 s u u.printPoint() u.printPoint u printPoint koch(n-1, u, t) koch n-1 n 1 u t t.printPoint() t.printPoint t printPoint koch(n-1, t, p2) koch n-1 n 1 t p2 n n p1 p1 p2 p2 n = int(raw_input()) n int(raw_input()) int raw_input() raw_input p1 = Point_Class(0.0, 0.0) p1 Point_Class(0.0, 0.0) Point_Class 0.0 0.0 p2 = Point_Class(100.0, 0.0) p2 Point_Class(100.0, 0.0) Point_Class 100.0 0.0 p1.printPoint() p1.printPoint p1 printPoint koch(n, p1, p2) koch n p1 p2 p2.printPoint() p2.printPoint p2 printPoint p2 = Point_Class(100.0, 0.0) Point_Class(100.0, 0.0) p2 n = int(raw_input()) int(raw_input()) n class Point_Class:
    def __init__(self, x, y):
        self.x  =   x
        self.y  =   y

    def printPoint(self):
        print "%f %f" %(self.x, self.y) class Point_Class:
    def __init__(self, x, y):
        self.x  =   x
        self.y  =   y

    def printPoint(self):
        print "%f %f" %(self.x, self.y) Point_Class def koch(n, p1, p2):
    if n == 0:
        return
    sin60 = math.sin(math.radians(60))
    cos60 = math.cos(math.radians(60))
    s = Point_Class((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Point_Class((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    u = Point_Class((t.x-s.x)*cos60-(t.y-s.y)*sin60+s.x, (t.x-s.x)*sin60+(t.y-s.y)*cos60+s.y)
    koch(n-1, p1, s)
    s.printPoint()
    koch(n-1, s, u)
    u.printPoint()
    koch(n-1, u, t)
    t.printPoint()
    koch(n-1, t, p2) def koch(n, p1, p2):
    if n == 0:
        return
    sin60 = math.sin(math.radians(60))
    cos60 = math.cos(math.radians(60))
    s = Point_Class((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Point_Class((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    u = Point_Class((t.x-s.x)*cos60-(t.y-s.y)*sin60+s.x, (t.x-s.x)*sin60+(t.y-s.y)*cos60+s.y)
    koch(n-1, p1, s)
    s.printPoint()
    koch(n-1, s, u)
    u.printPoint()
    koch(n-1, u, t)
    t.printPoint()
    koch(n-1, t, p2) koch p1 = Point_Class(0.0, 0.0) Point_Class(0.0, 0.0) p1
# -*- coding: utf-8 -*-

import math

class Point_Class:
    def __init__(self, x, y):
        self.x  =   x
        self.y  =   y

    def printPoint(self):
        print "%f %f" %(self.x, self.y)

def koch(n, p1, p2):
    if n == 0:
        return
    sin60 = math.sin(math.radians(60))
    cos60 = math.cos(math.radians(60))
    s = Point_Class((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Point_Class((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    u = Point_Class((t.x-s.x)*cos60-(t.y-s.y)*sin60+s.x, (t.x-s.x)*sin60+(t.y-s.y)*cos60+s.y)
    koch(n-1, p1, s)
    s.printPoint()
    koch(n-1, s, u)
    u.printPoint()
    koch(n-1, u, t)
    t.printPoint()
    koch(n-1, t, p2)

n = int(raw_input())
p1 = Point_Class(0.0, 0.0)
p2 = Point_Class(100.0, 0.0)
p1.printPoint()
koch(n, p1, p2)
p2.printPoint()