#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
from math import pi, sin, cos

COS_PI_3 = cos(pi / 3.0)
SIN_PI_3 = sin(pi / 3.0)


def koch_curve(s, e, n):
    if not n:
        return (s, e)
    x = (e[0]-s[0]) / 3.0
    y = (e[1]-s[1]) / 3.0
    p1 = (s[0] + x, s[1] + y)
    p2 = (x*COS_PI_3 - y*SIN_PI_3 + p1[0], x*SIN_PI_3 + y*COS_PI_3 + p1[1])
    p3 = (e[0] - x, e[1] - y)
    return (koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] +
            koch_curve(p2, p3, n-1)[1:] + koch_curve(p3, e, n-1)[1:])


n = int(stdin.readline())
for x, y in koch_curve((0, 0), (100, 0), n):
    print('{:.8f} {:.8f}'.format(x, y)) from __future__ import division, print_function from sys import stdin from math import pi, sin, cos COS_PI_3 = cos(pi / 3.0) COS_PI_3 cos(pi / 3.0) cos pi / 3.0 pi 3.0 SIN_PI_3 = sin(pi / 3.0) SIN_PI_3 sin(pi / 3.0) sin pi / 3.0 pi 3.0 def koch_curve(s, e, n):
    if not n:
        return (s, e)
    x = (e[0]-s[0]) / 3.0
    y = (e[1]-s[1]) / 3.0
    p1 = (s[0] + x, s[1] + y)
    p2 = (x*COS_PI_3 - y*SIN_PI_3 + p1[0], x*SIN_PI_3 + y*COS_PI_3 + p1[1])
    p3 = (e[0] - x, e[1] - y)
    return (koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] +
            koch_curve(p2, p3, n-1)[1:] + koch_curve(p3, e, n-1)[1:]) koch_curve if not n:
        return (s, e)
     not n n return (s, e) (s, e) s e x = (e[0]-s[0]) / 3.0 x (e[0]-s[0]) / 3.0 e[0]-s[0] e[0] e 0 s[0] s 0 3.0 y = (e[1]-s[1]) / 3.0 y (e[1]-s[1]) / 3.0 e[1]-s[1] e[1] e 1 s[1] s 1 3.0 p1 = (s[0] + x, s[1] + y) p1 (s[0] + x, s[1] + y) s[0] + x s[0] s 0 x s[1] + y s[1] s 1 y p2 = (x*COS_PI_3 - y*SIN_PI_3 + p1[0], x*SIN_PI_3 + y*COS_PI_3 + p1[1]) p2 (x*COS_PI_3 - y*SIN_PI_3 + p1[0], x*SIN_PI_3 + y*COS_PI_3 + p1[1]) x*COS_PI_3 - y*SIN_PI_3 + p1[0] x*COS_PI_3 - y*SIN_PI_3 x*COS_PI_3 x COS_PI_3 y*SIN_PI_3 y SIN_PI_3 p1[0] p1 0 x*SIN_PI_3 + y*COS_PI_3 + p1[1] x*SIN_PI_3 + y*COS_PI_3 x*SIN_PI_3 x SIN_PI_3 y*COS_PI_3 y COS_PI_3 p1[1] p1 1 p3 = (e[0] - x, e[1] - y) p3 (e[0] - x, e[1] - y) e[0] - x e[0] e 0 x e[1] - y e[1] e 1 y return (koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] +
            koch_curve(p2, p3, n-1)[1:] + koch_curve(p3, e, n-1)[1:]) koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] +
            koch_curve(p2, p3, n-1)[1:] + koch_curve(p3, e, n-1)[1:] koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] +
            koch_curve(p2, p3, n-1)[1:] koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] koch_curve(s, p1, n-1) koch_curve s p1 n-1 n 1 koch_curve(p1, p2, n-1)[1:] (p1, p2, n-1) koch_curve p1 p2 n-1 n 1 1: 1 koch_curve(p2, p3, n-1)[1:] (p2, p3, n-1) koch_curve p2 p3 n-1 n 1 1: 1 koch_curve(p3, e, n-1)[1:] (p3, e, n-1) koch_curve p3 e n-1 n 1 1: 1 s s e e n n n = int(stdin.readline()) n int(stdin.readline()) int stdin.readline() stdin.readline stdin readline for x, y in koch_curve((0, 0), (100, 0), n):
    print('{:.8f} {:.8f}'.format(x, y)) x y koch_curve((0, 0), (100, 0), n) koch_curve (0, 0) 0 0 (100, 0) 100 0 n print('{:.8f} {:.8f}'.format(x, y)) print '{:.8f} {:.8f}'.format(x, y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format x y SIN_PI_3 = sin(pi / 3.0) sin(pi / 3.0) SIN_PI_3 def koch_curve(s, e, n):
    if not n:
        return (s, e)
    x = (e[0]-s[0]) / 3.0
    y = (e[1]-s[1]) / 3.0
    p1 = (s[0] + x, s[1] + y)
    p2 = (x*COS_PI_3 - y*SIN_PI_3 + p1[0], x*SIN_PI_3 + y*COS_PI_3 + p1[1])
    p3 = (e[0] - x, e[1] - y)
    return (koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] +
            koch_curve(p2, p3, n-1)[1:] + koch_curve(p3, e, n-1)[1:]) def koch_curve(s, e, n):
    if not n:
        return (s, e)
    x = (e[0]-s[0]) / 3.0
    y = (e[1]-s[1]) / 3.0
    p1 = (s[0] + x, s[1] + y)
    p2 = (x*COS_PI_3 - y*SIN_PI_3 + p1[0], x*SIN_PI_3 + y*COS_PI_3 + p1[1])
    p3 = (e[0] - x, e[1] - y)
    return (koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] +
            koch_curve(p2, p3, n-1)[1:] + koch_curve(p3, e, n-1)[1:]) koch_curve COS_PI_3 = cos(pi / 3.0) cos(pi / 3.0) COS_PI_3 n = int(stdin.readline()) int(stdin.readline()) n
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
from math import pi, sin, cos

COS_PI_3 = cos(pi / 3.0)
SIN_PI_3 = sin(pi / 3.0)


def koch_curve(s, e, n):
    if not n:
        return (s, e)
    x = (e[0]-s[0]) / 3.0
    y = (e[1]-s[1]) / 3.0
    p1 = (s[0] + x, s[1] + y)
    p2 = (x*COS_PI_3 - y*SIN_PI_3 + p1[0], x*SIN_PI_3 + y*COS_PI_3 + p1[1])
    p3 = (e[0] - x, e[1] - y)
    return (koch_curve(s, p1, n-1) + koch_curve(p1, p2, n-1)[1:] +
            koch_curve(p2, p3, n-1)[1:] + koch_curve(p3, e, n-1)[1:])


n = int(stdin.readline())
for x, y in koch_curve((0, 0), (100, 0), n):
    print('{:.8f} {:.8f}'.format(x, y))