import math

n = int(raw_input())

class Coord():
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def show(self):
        print self.x, self.y

def calcCoord(N, start, end):
    if N == 0:
        return [start]
    s = Coord((start.x * 2.0 + end.x) /3, (start.y * 2.0 + end.y) /3)
    t = Coord((start.x + end.x * 2.0) /3, (start.y + end.y * 2.0) /3)
    u = Coord(((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 + s.x, ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 + s.y)
    if N == 1:
        return [start, s, u, t]
    return calcCoord(N-1, start, s) + calcCoord(N-1, s, u) + calcCoord(N-1, u, t) + calcCoord(N-1, t, end)
    
start = Coord(0.0, 0.0)
end = Coord(100.0, 0.0)
ans = calcCoord(n, start, end) + [end]
for i in range(len(ans)):
    print ans[i].x, ans[i].y import math math n = int(raw_input()) n int(raw_input()) int raw_input() raw_input class Coord():
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def show(self):
        print self.x, self.y Coord 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 show(self):
        print self.x, self.y show print self.x self x self.y self y self self def calcCoord(N, start, end):
    if N == 0:
        return [start]
    s = Coord((start.x * 2.0 + end.x) /3, (start.y * 2.0 + end.y) /3)
    t = Coord((start.x + end.x * 2.0) /3, (start.y + end.y * 2.0) /3)
    u = Coord(((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 + s.x, ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 + s.y)
    if N == 1:
        return [start, s, u, t]
    return calcCoord(N-1, start, s) + calcCoord(N-1, s, u) + calcCoord(N-1, u, t) + calcCoord(N-1, t, end)
     calcCoord if N == 0:
        return [start]
     N == 0 N 0 return [start] [start] start s = Coord((start.x * 2.0 + end.x) /3, (start.y * 2.0 + end.y) /3) s Coord((start.x * 2.0 + end.x) /3, (start.y * 2.0 + end.y) /3) Coord (start.x * 2.0 + end.x) /3 start.x * 2.0 + end.x start.x * 2.0 start.x start x 2.0 end.x end x 3 (start.y * 2.0 + end.y) /3 start.y * 2.0 + end.y start.y * 2.0 start.y start y 2.0 end.y end y 3 t = Coord((start.x + end.x * 2.0) /3, (start.y + end.y * 2.0) /3) t Coord((start.x + end.x * 2.0) /3, (start.y + end.y * 2.0) /3) Coord (start.x + end.x * 2.0) /3 start.x + end.x * 2.0 start.x start x end.x * 2.0 end.x end x 2.0 3 (start.y + end.y * 2.0) /3 start.y + end.y * 2.0 start.y start y end.y * 2.0 end.y end y 2.0 3 u = Coord(((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 + s.x, ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 + s.y) u Coord(((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 + s.x, ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 + s.y) Coord ((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 + s.x ((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 (t.x-s.x) - (t.y-s.y) * math.sqrt(3) t.x-s.x t.x t x s.x s x (t.y-s.y) * math.sqrt(3) t.y-s.y t.y t y s.y s y math.sqrt(3) math.sqrt math sqrt 3 2 s.x s x ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 + s.y ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 (t.x-s.x) * math.sqrt(3) + (t.y-s.y) (t.x-s.x) * math.sqrt(3) t.x-s.x t.x t x s.x s x math.sqrt(3) math.sqrt math sqrt 3 t.y-s.y t.y t y s.y s y 2 s.y s y if N == 1:
        return [start, s, u, t]
     N == 1 N 1 return [start, s, u, t] [start, s, u, t] start s u t return calcCoord(N-1, start, s) + calcCoord(N-1, s, u) + calcCoord(N-1, u, t) + calcCoord(N-1, t, end) calcCoord(N-1, start, s) + calcCoord(N-1, s, u) + calcCoord(N-1, u, t) + calcCoord(N-1, t, end) calcCoord(N-1, start, s) + calcCoord(N-1, s, u) + calcCoord(N-1, u, t) calcCoord(N-1, start, s) + calcCoord(N-1, s, u) calcCoord(N-1, start, s) calcCoord N-1 N 1 start s calcCoord(N-1, s, u) calcCoord N-1 N 1 s u calcCoord(N-1, u, t) calcCoord N-1 N 1 u t calcCoord(N-1, t, end) calcCoord N-1 N 1 t end N N start start end end start = Coord(0.0, 0.0) start Coord(0.0, 0.0) Coord 0.0 0.0 end = Coord(100.0, 0.0) end Coord(100.0, 0.0) Coord 100.0 0.0 ans = calcCoord(n, start, end) + [end] ans calcCoord(n, start, end) + [end] calcCoord(n, start, end) calcCoord n start end [end] end for i in range(len(ans)):
    print ans[i].x, ans[i].y i range(len(ans)) range len(ans) len ans print ans[i].x [i] ans i x ans[i].y [i] ans i y class Coord():
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def show(self):
        print self.x, self.y class Coord():
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def show(self):
        print self.x, self.y Coord def calcCoord(N, start, end):
    if N == 0:
        return [start]
    s = Coord((start.x * 2.0 + end.x) /3, (start.y * 2.0 + end.y) /3)
    t = Coord((start.x + end.x * 2.0) /3, (start.y + end.y * 2.0) /3)
    u = Coord(((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 + s.x, ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 + s.y)
    if N == 1:
        return [start, s, u, t]
    return calcCoord(N-1, start, s) + calcCoord(N-1, s, u) + calcCoord(N-1, u, t) + calcCoord(N-1, t, end)
     def calcCoord(N, start, end):
    if N == 0:
        return [start]
    s = Coord((start.x * 2.0 + end.x) /3, (start.y * 2.0 + end.y) /3)
    t = Coord((start.x + end.x * 2.0) /3, (start.y + end.y * 2.0) /3)
    u = Coord(((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 + s.x, ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 + s.y)
    if N == 1:
        return [start, s, u, t]
    return calcCoord(N-1, start, s) + calcCoord(N-1, s, u) + calcCoord(N-1, u, t) + calcCoord(N-1, t, end)
     calcCoord end = Coord(100.0, 0.0) Coord(100.0, 0.0) end ans = calcCoord(n, start, end) + [end] calcCoord(n, start, end) + [end] ans n = int(raw_input()) int(raw_input()) n start = Coord(0.0, 0.0) Coord(0.0, 0.0) start
import math

n = int(raw_input())

class Coord():
    def __init__(self, x, y):
        self.x = x
        self.y = y
    def show(self):
        print self.x, self.y

def calcCoord(N, start, end):
    if N == 0:
        return [start]
    s = Coord((start.x * 2.0 + end.x) /3, (start.y * 2.0 + end.y) /3)
    t = Coord((start.x + end.x * 2.0) /3, (start.y + end.y * 2.0) /3)
    u = Coord(((t.x-s.x) - (t.y-s.y) * math.sqrt(3)) /2 + s.x, ((t.x-s.x) * math.sqrt(3) + (t.y-s.y)) /2 + s.y)
    if N == 1:
        return [start, s, u, t]
    return calcCoord(N-1, start, s) + calcCoord(N-1, s, u) + calcCoord(N-1, u, t) + calcCoord(N-1, t, end)
    
start = Coord(0.0, 0.0)
end = Coord(100.0, 0.0)
ans = calcCoord(n, start, end) + [end]
for i in range(len(ans)):
    print ans[i].x, ans[i].y