#include <stdio.h>
#include <math.h>
 
typedef struct _Point {
  double x, y;
} Point;
 
typedef Point Vector;
 
Vector add(Vector a, Vector b) {
  a.x += b.x;
  a.y += b.y;
  return a;
}
 
Vector subtract(Vector a, Vector b) {
  a.x -= b.x;
  a.y -= b.y;
  return a;
}
 
Vector multiply(Vector a, double b) {
  a.x *= b;
  a.y *= b;
  return a;
}
 
Vector divide(Vector a, double b) {
  a.x /= b;
  a.y /= b;
  return a;
}
 
Vector rotate(Vector v, double angle) {
  Vector nv;
  nv.x = v.x * cos(angle) - v.y * sin(angle);
  nv.y = v.x * sin(angle) + v.y * cos(angle);
  return nv;
}
 
Point rec(int n, Point a, Point b) {
  Vector v,u;
  Point c,d,e;
  if(n == 0) {
    printf("%.8f %.8f\n", a.x, a.y);
    return;
  }
  v = subtract(b,a);
  u = divide(v,3.0);
  c = add(a,u);
  d = add(c,u);
  e = add(c,rotate(u,M_PI/3.0));
  rec(n-1, a, c);
  rec(n-1, c, e);
  rec(n-1, e, d);
  rec(n-1, d, b);
}
 
int main() {
  int n;
  scanf("%d", &n);
  rec(n, (Point){0.0, 0.0}, (Point){100.0, 0.0});
  printf("%.8f %.8f\n", 100.0, 0.0);
  return 0;
}
