(function() {
    'use strict';

    var koch = function() {
        var cos60 = Math.cos(60.0 * Math.PI / 180.0);
        var sin60 = Math.sin(60.0 * Math.PI / 180.0);

        function inner(n, p1x, p1y, p2x, p2y) {
            if (n == 0)
                return;
            var sx = (2 * p1x + p2x) / 3;
            var sy = (2 * p1y + p2y) / 3;

            var tx = (p1x + 2 * p2x) / 3;
            var ty = (p1y + 2 * p2y) / 3;

            var dx = tx - sx;
            var dy = ty - sy;
            var ux = sx + dx * cos60 - dy * sin60;
            var uy = sy + dx * sin60 + dy * cos60;

            inner(n - 1, p1x, p1y, sx, sy);
            console.log(sx + " " + sy);
            inner(n - 1, sx, sy, ux, uy);
            console.log(ux + " " + uy);
            inner(n - 1, ux, uy, tx, ty);
            console.log(tx + " " + ty);
            inner(n - 1, tx, ty, p2x, p2y);
        }
        return inner;
    };

    var fs = require('fs');
    var contents = fs.readFileSync('/dev/stdin', 'utf-8');
    var n = parseInt(contents.trim());

    var kochFunc = koch();
    console.log(0.00000 + " " + 0.0000);
    kochFunc(n, 0, 0, 100.0, 0);
    console.log(100.00000000 + " " + 0.00000000);
})();