import math

def koch(n, a, b):
    if n == 0: return

    s, t, u = [0, 0], [0, 0], [0, 0];
    th = math.pi * 60.0 / 180.0;

    s[0] = (2.0 * a[0] + 1.0 * b[0]) / 3.0
    s[1] = (2.0 * a[1] + 1.0 * b[1]) / 3.0
    t[0] = (1.0 * a[0] + 2.0 * b[0]) / 3.0
    t[1] = (1.0 * a[1] + 2.0 * b[1]) / 3.0
    u[0] = (t[0] - s[0]) * math.cos(th) - (t[1] - s[1]) * math.sin(th) + s[0]
    u[1] = (t[0] - s[0]) * math.sin(th) + (t[1] - s[1]) * math.cos(th) + s[1]

    koch(n - 1, a, s)
    print "%.8f %.8f" % (s[0], s[1])

    koch(n - 1, s, u);
    print "%.8f %.8f" % (u[0], u[1])

    koch(n - 1, u, t)
    print "%.8f %.8f" % (t[0], t[1])

    koch(n - 1, t, b);

def main():
    a, b = [0, 0], [0, 0]

    n = int(raw_input())

    a[0], a[1] = 0, 0
    b[0], b[1] = 100, 0;

    print "%.8f %.8f" % (a[0], a[1])
    koch(n, a, b);
    print "%.8f %.8f" % (b[0], b[1])

main() import math math def koch(n, a, b):
    if n == 0: return

    s, t, u = [0, 0], [0, 0], [0, 0];
    th = math.pi * 60.0 / 180.0;

    s[0] = (2.0 * a[0] + 1.0 * b[0]) / 3.0
    s[1] = (2.0 * a[1] + 1.0 * b[1]) / 3.0
    t[0] = (1.0 * a[0] + 2.0 * b[0]) / 3.0
    t[1] = (1.0 * a[1] + 2.0 * b[1]) / 3.0
    u[0] = (t[0] - s[0]) * math.cos(th) - (t[1] - s[1]) * math.sin(th) + s[0]
    u[1] = (t[0] - s[0]) * math.sin(th) + (t[1] - s[1]) * math.cos(th) + s[1]

    koch(n - 1, a, s)
    print "%.8f %.8f" % (s[0], s[1])

    koch(n - 1, s, u);
    print "%.8f %.8f" % (u[0], u[1])

    koch(n - 1, u, t)
    print "%.8f %.8f" % (t[0], t[1])

    koch(n - 1, t, b); koch if n == 0: return

     n == 0 n 0 s, t, u = [0, 0], [0, 0], [0, 0] s [0, 0] 0 0 t [0, 0] 0 0 u [0, 0] 0 0 th = math.pi * 60.0 / 180.0 th math.pi * 60.0 / 180.0 math.pi * 60.0 math.pi math pi 60.0 180.0 s[0] = (2.0 * a[0] + 1.0 * b[0]) / 3.0 s[0] s 0 (2.0 * a[0] + 1.0 * b[0]) / 3.0 2.0 * a[0] + 1.0 * b[0] 2.0 * a[0] 2.0 a[0] a 0 1.0 * b[0] 1.0 b[0] b 0 3.0 s[1] = (2.0 * a[1] + 1.0 * b[1]) / 3.0 s[1] s 1 (2.0 * a[1] + 1.0 * b[1]) / 3.0 2.0 * a[1] + 1.0 * b[1] 2.0 * a[1] 2.0 a[1] a 1 1.0 * b[1] 1.0 b[1] b 1 3.0 t[0] = (1.0 * a[0] + 2.0 * b[0]) / 3.0 t[0] t 0 (1.0 * a[0] + 2.0 * b[0]) / 3.0 1.0 * a[0] + 2.0 * b[0] 1.0 * a[0] 1.0 a[0] a 0 2.0 * b[0] 2.0 b[0] b 0 3.0 t[1] = (1.0 * a[1] + 2.0 * b[1]) / 3.0 t[1] t 1 (1.0 * a[1] + 2.0 * b[1]) / 3.0 1.0 * a[1] + 2.0 * b[1] 1.0 * a[1] 1.0 a[1] a 1 2.0 * b[1] 2.0 b[1] b 1 3.0 u[0] = (t[0] - s[0]) * math.cos(th) - (t[1] - s[1]) * math.sin(th) + s[0] u[0] u 0 (t[0] - s[0]) * math.cos(th) - (t[1] - s[1]) * math.sin(th) + s[0] (t[0] - s[0]) * math.cos(th) - (t[1] - s[1]) * math.sin(th) (t[0] - s[0]) * math.cos(th) t[0] - s[0] t[0] t 0 s[0] s 0 math.cos(th) math.cos math cos th (t[1] - s[1]) * math.sin(th) t[1] - s[1] t[1] t 1 s[1] s 1 math.sin(th) math.sin math sin th s[0] s 0 u[1] = (t[0] - s[0]) * math.sin(th) + (t[1] - s[1]) * math.cos(th) + s[1] u[1] u 1 (t[0] - s[0]) * math.sin(th) + (t[1] - s[1]) * math.cos(th) + s[1] (t[0] - s[0]) * math.sin(th) + (t[1] - s[1]) * math.cos(th) (t[0] - s[0]) * math.sin(th) t[0] - s[0] t[0] t 0 s[0] s 0 math.sin(th) math.sin math sin th (t[1] - s[1]) * math.cos(th) t[1] - s[1] t[1] t 1 s[1] s 1 math.cos(th) math.cos math cos th s[1] s 1 koch(n - 1, a, s) koch n - 1 n 1 a s print "%.8f %.8f" % (s[0], s[1]) "%.8f %.8f" (s[0], s[1]) s[0] s 0 s[1] s 1 koch(n - 1, s, u) koch n - 1 n 1 s u print "%.8f %.8f" % (u[0], u[1]) "%.8f %.8f" (u[0], u[1]) u[0] u 0 u[1] u 1 koch(n - 1, u, t) koch n - 1 n 1 u t print "%.8f %.8f" % (t[0], t[1]) "%.8f %.8f" (t[0], t[1]) t[0] t 0 t[1] t 1 koch(n - 1, t, b) koch n - 1 n 1 t b n n a a b b def main():
    a, b = [0, 0], [0, 0]

    n = int(raw_input())

    a[0], a[1] = 0, 0
    b[0], b[1] = 100, 0;

    print "%.8f %.8f" % (a[0], a[1])
    koch(n, a, b);
    print "%.8f %.8f" % (b[0], b[1]) main a, b = [0, 0], [0, 0] a [0, 0] 0 0 b [0, 0] 0 0 n = int(raw_input()) n int(raw_input()) int raw_input() raw_input a[0], a[1] = 0, 0 a[0] a 0 0 a[1] a 1 0 b[0], b[1] = 100, 0 b[0] b 0 100 b[1] b 1 0 print "%.8f %.8f" % (a[0], a[1]) "%.8f %.8f" (a[0], a[1]) a[0] a 0 a[1] a 1 koch(n, a, b) koch n a b print "%.8f %.8f" % (b[0], b[1]) "%.8f %.8f" (b[0], b[1]) b[0] b 0 b[1] b 1 main() main def main():
    a, b = [0, 0], [0, 0]

    n = int(raw_input())

    a[0], a[1] = 0, 0
    b[0], b[1] = 100, 0;

    print "%.8f %.8f" % (a[0], a[1])
    koch(n, a, b);
    print "%.8f %.8f" % (b[0], b[1]) def main():
    a, b = [0, 0], [0, 0]

    n = int(raw_input())

    a[0], a[1] = 0, 0
    b[0], b[1] = 100, 0;

    print "%.8f %.8f" % (a[0], a[1])
    koch(n, a, b);
    print "%.8f %.8f" % (b[0], b[1]) main def koch(n, a, b):
    if n == 0: return

    s, t, u = [0, 0], [0, 0], [0, 0];
    th = math.pi * 60.0 / 180.0;

    s[0] = (2.0 * a[0] + 1.0 * b[0]) / 3.0
    s[1] = (2.0 * a[1] + 1.0 * b[1]) / 3.0
    t[0] = (1.0 * a[0] + 2.0 * b[0]) / 3.0
    t[1] = (1.0 * a[1] + 2.0 * b[1]) / 3.0
    u[0] = (t[0] - s[0]) * math.cos(th) - (t[1] - s[1]) * math.sin(th) + s[0]
    u[1] = (t[0] - s[0]) * math.sin(th) + (t[1] - s[1]) * math.cos(th) + s[1]

    koch(n - 1, a, s)
    print "%.8f %.8f" % (s[0], s[1])

    koch(n - 1, s, u);
    print "%.8f %.8f" % (u[0], u[1])

    koch(n - 1, u, t)
    print "%.8f %.8f" % (t[0], t[1])

    koch(n - 1, t, b); def koch(n, a, b):
    if n == 0: return

    s, t, u = [0, 0], [0, 0], [0, 0];
    th = math.pi * 60.0 / 180.0;

    s[0] = (2.0 * a[0] + 1.0 * b[0]) / 3.0
    s[1] = (2.0 * a[1] + 1.0 * b[1]) / 3.0
    t[0] = (1.0 * a[0] + 2.0 * b[0]) / 3.0
    t[1] = (1.0 * a[1] + 2.0 * b[1]) / 3.0
    u[0] = (t[0] - s[0]) * math.cos(th) - (t[1] - s[1]) * math.sin(th) + s[0]
    u[1] = (t[0] - s[0]) * math.sin(th) + (t[1] - s[1]) * math.cos(th) + s[1]

    koch(n - 1, a, s)
    print "%.8f %.8f" % (s[0], s[1])

    koch(n - 1, s, u);
    print "%.8f %.8f" % (u[0], u[1])

    koch(n - 1, u, t)
    print "%.8f %.8f" % (t[0], t[1])

    koch(n - 1, t, b); koch
import math

def koch(n, a, b):
    if n == 0: return

    s, t, u = [0, 0], [0, 0], [0, 0];
    th = math.pi * 60.0 / 180.0;

    s[0] = (2.0 * a[0] + 1.0 * b[0]) / 3.0
    s[1] = (2.0 * a[1] + 1.0 * b[1]) / 3.0
    t[0] = (1.0 * a[0] + 2.0 * b[0]) / 3.0
    t[1] = (1.0 * a[1] + 2.0 * b[1]) / 3.0
    u[0] = (t[0] - s[0]) * math.cos(th) - (t[1] - s[1]) * math.sin(th) + s[0]
    u[1] = (t[0] - s[0]) * math.sin(th) + (t[1] - s[1]) * math.cos(th) + s[1]

    koch(n - 1, a, s)
    print "%.8f %.8f" % (s[0], s[1])

    koch(n - 1, s, u);
    print "%.8f %.8f" % (u[0], u[1])

    koch(n - 1, u, t)
    print "%.8f %.8f" % (t[0], t[1])

    koch(n - 1, t, b);

def main():
    a, b = [0, 0], [0, 0]

    n = int(raw_input())

    a[0], a[1] = 0, 0
    b[0], b[1] = 100, 0;

    print "%.8f %.8f" % (a[0], a[1])
    koch(n, a, b);
    print "%.8f %.8f" % (b[0], b[1])

main()