from math import *
def koch(n, a, b):
    if n == 0:
        return
    th = pi * 60.0 / 180.0
    s = complex((2.0 * a.real + 1.0 * b.real) / 3.0, (2.0 * a.imag + 1.0 * b.imag) / 3.0)
    t = complex((1.0 * a.real + 2.0 * b.real) / 3.0, (1.0 * a.imag + 2.0 * b.imag) / 3.0)
    u = complex((t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) + s.real,
                (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) + s.imag)
    koch(n - 1, a, s)
    print(s.real, s.imag)
    koch(n - 1, s, u)
    print(u.real, u.imag)
    koch(n - 1, u, t)
    print(t.real, t.imag)
    koch(n - 1, t, b)
n = int(input())
a = complex(0, 0)
b = complex(100, 0)
print(a.real, a.imag)
koch(n, a, b)
print(b.real, b.imag)
 from math import * def koch(n, a, b):
    if n == 0:
        return
    th = pi * 60.0 / 180.0
    s = complex((2.0 * a.real + 1.0 * b.real) / 3.0, (2.0 * a.imag + 1.0 * b.imag) / 3.0)
    t = complex((1.0 * a.real + 2.0 * b.real) / 3.0, (1.0 * a.imag + 2.0 * b.imag) / 3.0)
    u = complex((t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) + s.real,
                (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) + s.imag)
    koch(n - 1, a, s)
    print(s.real, s.imag)
    koch(n - 1, s, u)
    print(u.real, u.imag)
    koch(n - 1, u, t)
    print(t.real, t.imag)
    koch(n - 1, t, b) koch if n == 0:
        return
     n == 0 n 0 return th = pi * 60.0 / 180.0 th pi * 60.0 / 180.0 pi * 60.0 pi 60.0 180.0 s = complex((2.0 * a.real + 1.0 * b.real) / 3.0, (2.0 * a.imag + 1.0 * b.imag) / 3.0) s complex((2.0 * a.real + 1.0 * b.real) / 3.0, (2.0 * a.imag + 1.0 * b.imag) / 3.0) complex (2.0 * a.real + 1.0 * b.real) / 3.0 2.0 * a.real + 1.0 * b.real 2.0 * a.real 2.0 a.real a real 1.0 * b.real 1.0 b.real b real 3.0 (2.0 * a.imag + 1.0 * b.imag) / 3.0 2.0 * a.imag + 1.0 * b.imag 2.0 * a.imag 2.0 a.imag a imag 1.0 * b.imag 1.0 b.imag b imag 3.0 t = complex((1.0 * a.real + 2.0 * b.real) / 3.0, (1.0 * a.imag + 2.0 * b.imag) / 3.0) t complex((1.0 * a.real + 2.0 * b.real) / 3.0, (1.0 * a.imag + 2.0 * b.imag) / 3.0) complex (1.0 * a.real + 2.0 * b.real) / 3.0 1.0 * a.real + 2.0 * b.real 1.0 * a.real 1.0 a.real a real 2.0 * b.real 2.0 b.real b real 3.0 (1.0 * a.imag + 2.0 * b.imag) / 3.0 1.0 * a.imag + 2.0 * b.imag 1.0 * a.imag 1.0 a.imag a imag 2.0 * b.imag 2.0 b.imag b imag 3.0 u = complex((t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) + s.real,
                (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) + s.imag) u complex((t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) + s.real,
                (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) + s.imag) complex (t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) + s.real (t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) (t.real - s.real) * cos(th) t.real - s.real t.real t real s.real s real cos(th) cos th (t.imag - s.imag) * sin(th) t.imag - s.imag t.imag t imag s.imag s imag sin(th) sin th s.real s real (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) + s.imag (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) (t.real - s.real) * sin(th) t.real - s.real t.real t real s.real s real sin(th) sin th (t.imag - s.imag) * cos(th) t.imag - s.imag t.imag t imag s.imag s imag cos(th) cos th s.imag s imag koch(n - 1, a, s) koch n - 1 n 1 a s print(s.real, s.imag) print s.real s real s.imag s imag koch(n - 1, s, u) koch n - 1 n 1 s u print(u.real, u.imag) print u.real u real u.imag u imag koch(n - 1, u, t) koch n - 1 n 1 u t print(t.real, t.imag) print t.real t real t.imag t imag koch(n - 1, t, b) koch n - 1 n 1 t b n n a a b b n = int(input()) n int(input()) int input() input a = complex(0, 0) a complex(0, 0) complex 0 0 b = complex(100, 0) b complex(100, 0) complex 100 0 print(a.real, a.imag) print a.real a real a.imag a imag koch(n, a, b) koch n a b print(b.real, b.imag) print b.real b real b.imag b imag n = int(input()) int(input()) n def koch(n, a, b):
    if n == 0:
        return
    th = pi * 60.0 / 180.0
    s = complex((2.0 * a.real + 1.0 * b.real) / 3.0, (2.0 * a.imag + 1.0 * b.imag) / 3.0)
    t = complex((1.0 * a.real + 2.0 * b.real) / 3.0, (1.0 * a.imag + 2.0 * b.imag) / 3.0)
    u = complex((t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) + s.real,
                (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) + s.imag)
    koch(n - 1, a, s)
    print(s.real, s.imag)
    koch(n - 1, s, u)
    print(u.real, u.imag)
    koch(n - 1, u, t)
    print(t.real, t.imag)
    koch(n - 1, t, b) def koch(n, a, b):
    if n == 0:
        return
    th = pi * 60.0 / 180.0
    s = complex((2.0 * a.real + 1.0 * b.real) / 3.0, (2.0 * a.imag + 1.0 * b.imag) / 3.0)
    t = complex((1.0 * a.real + 2.0 * b.real) / 3.0, (1.0 * a.imag + 2.0 * b.imag) / 3.0)
    u = complex((t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) + s.real,
                (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) + s.imag)
    koch(n - 1, a, s)
    print(s.real, s.imag)
    koch(n - 1, s, u)
    print(u.real, u.imag)
    koch(n - 1, u, t)
    print(t.real, t.imag)
    koch(n - 1, t, b) koch a = complex(0, 0) complex(0, 0) a b = complex(100, 0) complex(100, 0) b
from math import *
def koch(n, a, b):
    if n == 0:
        return
    th = pi * 60.0 / 180.0
    s = complex((2.0 * a.real + 1.0 * b.real) / 3.0, (2.0 * a.imag + 1.0 * b.imag) / 3.0)
    t = complex((1.0 * a.real + 2.0 * b.real) / 3.0, (1.0 * a.imag + 2.0 * b.imag) / 3.0)
    u = complex((t.real - s.real) * cos(th) - (t.imag - s.imag) * sin(th) + s.real,
                (t.real - s.real) * sin(th) + (t.imag - s.imag) * cos(th) + s.imag)
    koch(n - 1, a, s)
    print(s.real, s.imag)
    koch(n - 1, s, u)
    print(u.real, u.imag)
    koch(n - 1, u, t)
    print(t.real, t.imag)
    koch(n - 1, t, b)
n = int(input())
a = complex(0, 0)
b = complex(100, 0)
print(a.real, a.imag)
koch(n, a, b)
print(b.real, b.imag)

