import math


class vec2d(object):
    def __init__(self, x, y) -> None:
        self.x = float(x)
        self.y = float(y)

    def rot(self, theta: float):
        newx = self.x * math.cos(theta) - self.y * math.sin(theta)
        newy = self.x * math.sin(theta) + self.y * math.cos(theta)
        return vec2d(newx, newy)

    def __str__(self):
        return ' '.join(map(str, [self.x, self.y]))

    def __format__(self, format_spec):
        return ' '.join(map(lambda x: format(x, format_spec), [self.x, self.y]))

    def __add__(self, other):
        return vec2d(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return vec2d(self.x - other.x, self.y - other.y)

    def __mul__(self, k):
        return vec2d(self.x * k, self.y * k)

    def __truediv__(self, k):
        return self.__mul__(1 / k)

    def prod(self, other):
        return self.x * other.x + self.y * other.y


def cochcurve(p1, p2, n):
    if n > 0:
        pd = (p2 - p1) / 3
        ps = p1 + pd
        pu = ps + pd.rot(math.pi / 3)
        pt = ps + pd
        cochcurve(p1, ps, n-1)
        print(f'{ps:>12.6f}')
        cochcurve(ps, pu, n-1)
        print(f'{pu:>12.6f}')
        cochcurve(pu, pt, n-1)
        print(f'{pt:>12.6f}')
        cochcurve(pt, p2, n-1)


n = int(input())
S = vec2d(0, 0)
T = vec2d(100, 0)
print(f'{S:>12.6f}')
cochcurve(S, T, n)
print(f'{T:>12.6f}') import math math class vec2d(object):
    def __init__(self, x, y) -> None:
        self.x = float(x)
        self.y = float(y)

    def rot(self, theta: float):
        newx = self.x * math.cos(theta) - self.y * math.sin(theta)
        newy = self.x * math.sin(theta) + self.y * math.cos(theta)
        return vec2d(newx, newy)

    def __str__(self):
        return ' '.join(map(str, [self.x, self.y]))

    def __format__(self, format_spec):
        return ' '.join(map(lambda x: format(x, format_spec), [self.x, self.y]))

    def __add__(self, other):
        return vec2d(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return vec2d(self.x - other.x, self.y - other.y)

    def __mul__(self, k):
        return vec2d(self.x * k, self.y * k)

    def __truediv__(self, k):
        return self.__mul__(1 / k)

    def prod(self, other):
        return self.x * other.x + self.y * other.y vec2d def __init__(self, x, y) -> None:
        self.x = float(x)
        self.y = float(y)

     __init__ self.x = float(x) self.x self x float(x) float x self.y = float(y) self.y self y float(y) float y self self x x y y def rot(self, theta: float):
        newx = self.x * math.cos(theta) - self.y * math.sin(theta)
        newy = self.x * math.sin(theta) + self.y * math.cos(theta)
        return vec2d(newx, newy)

     rot newx = self.x * math.cos(theta) - self.y * math.sin(theta) newx self.x * math.cos(theta) - self.y * math.sin(theta) self.x * math.cos(theta) self.x self x math.cos(theta) math.cos math cos theta self.y * math.sin(theta) self.y self y math.sin(theta) math.sin math sin theta newy = self.x * math.sin(theta) + self.y * math.cos(theta) newy self.x * math.sin(theta) + self.y * math.cos(theta) self.x * math.sin(theta) self.x self x math.sin(theta) math.sin math sin theta self.y * math.cos(theta) self.y self y math.cos(theta) math.cos math cos theta return vec2d(newx, newy) vec2d(newx, newy) vec2d newx newy self self theta: float theta def __str__(self):
        return ' '.join(map(str, [self.x, self.y]))

     __str__ return ' '.join(map(str, [self.x, self.y])) ' '.join(map(str, [self.x, self.y])) ' '.join ' ' join map(str, [self.x, self.y]) map str [self.x, self.y] self.x self x self.y self y self self def __format__(self, format_spec):
        return ' '.join(map(lambda x: format(x, format_spec), [self.x, self.y]))

     __format__ return ' '.join(map(lambda x: format(x, format_spec), [self.x, self.y])) ' '.join(map(lambda x: format(x, format_spec), [self.x, self.y])) ' '.join ' ' join map(lambda x: format(x, format_spec), [self.x, self.y]) map lambda x: format(x, format_spec) format(x, format_spec) format x format_spec x [self.x, self.y] self.x self x self.y self y self self format_spec format_spec def __add__(self, other):
        return vec2d(self.x + other.x, self.y + other.y)

     __add__ return vec2d(self.x + other.x, self.y + other.y) vec2d(self.x + other.x, self.y + other.y) vec2d self.x + other.x self.x self x other.x other x self.y + other.y self.y self y other.y other y self self other other def __sub__(self, other):
        return vec2d(self.x - other.x, self.y - other.y)

     __sub__ return vec2d(self.x - other.x, self.y - other.y) vec2d(self.x - other.x, self.y - other.y) vec2d self.x - other.x self.x self x other.x other x self.y - other.y self.y self y other.y other y self self other other def __mul__(self, k):
        return vec2d(self.x * k, self.y * k)

     __mul__ return vec2d(self.x * k, self.y * k) vec2d(self.x * k, self.y * k) vec2d self.x * k self.x self x k self.y * k self.y self y k self self k k def __truediv__(self, k):
        return self.__mul__(1 / k)

     __truediv__ return self.__mul__(1 / k) self.__mul__(1 / k) self.__mul__ self __mul__ 1 / k 1 k self self k k def prod(self, other):
        return self.x * other.x + self.y * other.y prod return self.x * other.x + self.y * other.y self.x * other.x + self.y * other.y self.x * other.x self.x self x other.x other x self.y * other.y self.y self y other.y other y self self other other object def cochcurve(p1, p2, n):
    if n > 0:
        pd = (p2 - p1) / 3
        ps = p1 + pd
        pu = ps + pd.rot(math.pi / 3)
        pt = ps + pd
        cochcurve(p1, ps, n-1)
        print(f'{ps:>12.6f}')
        cochcurve(ps, pu, n-1)
        print(f'{pu:>12.6f}')
        cochcurve(pu, pt, n-1)
        print(f'{pt:>12.6f}')
        cochcurve(pt, p2, n-1) cochcurve if n > 0:
        pd = (p2 - p1) / 3
        ps = p1 + pd
        pu = ps + pd.rot(math.pi / 3)
        pt = ps + pd
        cochcurve(p1, ps, n-1)
        print(f'{ps:>12.6f}')
        cochcurve(ps, pu, n-1)
        print(f'{pu:>12.6f}')
        cochcurve(pu, pt, n-1)
        print(f'{pt:>12.6f}')
        cochcurve(pt, p2, n-1) n > 0 n 0 pd = (p2 - p1) / 3 pd (p2 - p1) / 3 p2 - p1 p2 p1 3 ps = p1 + pd ps p1 + pd p1 pd pu = ps + pd.rot(math.pi / 3) pu ps + pd.rot(math.pi / 3) ps pd.rot(math.pi / 3) pd.rot pd rot math.pi / 3 math.pi math pi 3 pt = ps + pd pt ps + pd ps pd cochcurve(p1, ps, n-1) cochcurve p1 ps n-1 n 1 print(f'{ps:>12.6f}') print f'{ps:>12.6f}' cochcurve(ps, pu, n-1) cochcurve ps pu n-1 n 1 print(f'{pu:>12.6f}') print f'{pu:>12.6f}' cochcurve(pu, pt, n-1) cochcurve pu pt n-1 n 1 print(f'{pt:>12.6f}') print f'{pt:>12.6f}' cochcurve(pt, p2, n-1) cochcurve pt p2 n-1 n 1 p1 p1 p2 p2 n n n = int(input()) n int(input()) int input() input S = vec2d(0, 0) S vec2d(0, 0) vec2d 0 0 T = vec2d(100, 0) T vec2d(100, 0) vec2d 100 0 print(f'{S:>12.6f}') print f'{S:>12.6f}' cochcurve(S, T, n) cochcurve S T n print(f'{T:>12.6f}') print f'{T:>12.6f}' S = vec2d(0, 0) vec2d(0, 0) S class vec2d(object):
    def __init__(self, x, y) -> None:
        self.x = float(x)
        self.y = float(y)

    def rot(self, theta: float):
        newx = self.x * math.cos(theta) - self.y * math.sin(theta)
        newy = self.x * math.sin(theta) + self.y * math.cos(theta)
        return vec2d(newx, newy)

    def __str__(self):
        return ' '.join(map(str, [self.x, self.y]))

    def __format__(self, format_spec):
        return ' '.join(map(lambda x: format(x, format_spec), [self.x, self.y]))

    def __add__(self, other):
        return vec2d(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return vec2d(self.x - other.x, self.y - other.y)

    def __mul__(self, k):
        return vec2d(self.x * k, self.y * k)

    def __truediv__(self, k):
        return self.__mul__(1 / k)

    def prod(self, other):
        return self.x * other.x + self.y * other.y class vec2d(object):
    def __init__(self, x, y) -> None:
        self.x = float(x)
        self.y = float(y)

    def rot(self, theta: float):
        newx = self.x * math.cos(theta) - self.y * math.sin(theta)
        newy = self.x * math.sin(theta) + self.y * math.cos(theta)
        return vec2d(newx, newy)

    def __str__(self):
        return ' '.join(map(str, [self.x, self.y]))

    def __format__(self, format_spec):
        return ' '.join(map(lambda x: format(x, format_spec), [self.x, self.y]))

    def __add__(self, other):
        return vec2d(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return vec2d(self.x - other.x, self.y - other.y)

    def __mul__(self, k):
        return vec2d(self.x * k, self.y * k)

    def __truediv__(self, k):
        return self.__mul__(1 / k)

    def prod(self, other):
        return self.x * other.x + self.y * other.y vec2d def cochcurve(p1, p2, n):
    if n > 0:
        pd = (p2 - p1) / 3
        ps = p1 + pd
        pu = ps + pd.rot(math.pi / 3)
        pt = ps + pd
        cochcurve(p1, ps, n-1)
        print(f'{ps:>12.6f}')
        cochcurve(ps, pu, n-1)
        print(f'{pu:>12.6f}')
        cochcurve(pu, pt, n-1)
        print(f'{pt:>12.6f}')
        cochcurve(pt, p2, n-1) def cochcurve(p1, p2, n):
    if n > 0:
        pd = (p2 - p1) / 3
        ps = p1 + pd
        pu = ps + pd.rot(math.pi / 3)
        pt = ps + pd
        cochcurve(p1, ps, n-1)
        print(f'{ps:>12.6f}')
        cochcurve(ps, pu, n-1)
        print(f'{pu:>12.6f}')
        cochcurve(pu, pt, n-1)
        print(f'{pt:>12.6f}')
        cochcurve(pt, p2, n-1) cochcurve T = vec2d(100, 0) vec2d(100, 0) T n = int(input()) int(input()) n
import math


class vec2d(object):
    def __init__(self, x, y) -> None:
        self.x = float(x)
        self.y = float(y)

    def rot(self, theta: float):
        newx = self.x * math.cos(theta) - self.y * math.sin(theta)
        newy = self.x * math.sin(theta) + self.y * math.cos(theta)
        return vec2d(newx, newy)

    def __str__(self):
        return ' '.join(map(str, [self.x, self.y]))

    def __format__(self, format_spec):
        return ' '.join(map(lambda x: format(x, format_spec), [self.x, self.y]))

    def __add__(self, other):
        return vec2d(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return vec2d(self.x - other.x, self.y - other.y)

    def __mul__(self, k):
        return vec2d(self.x * k, self.y * k)

    def __truediv__(self, k):
        return self.__mul__(1 / k)

    def prod(self, other):
        return self.x * other.x + self.y * other.y


def cochcurve(p1, p2, n):
    if n > 0:
        pd = (p2 - p1) / 3
        ps = p1 + pd
        pu = ps + pd.rot(math.pi / 3)
        pt = ps + pd
        cochcurve(p1, ps, n-1)
        print(f'{ps:>12.6f}')
        cochcurve(ps, pu, n-1)
        print(f'{pu:>12.6f}')
        cochcurve(pu, pt, n-1)
        print(f'{pt:>12.6f}')
        cochcurve(pt, p2, n-1)


n = int(input())
S = vec2d(0, 0)
T = vec2d(100, 0)
print(f'{S:>12.6f}')
cochcurve(S, T, n)
print(f'{T:>12.6f}')
