#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 20
static int su[N][N], x, y;
typedef enum{UP, RIGHT, DOWN, LEFT}dir;
unsigned nrand(int n){ return (unsigned)(n*(double)rand()/(RAND_MAX + 1.0));}
dir drand(void){ return nrand(4);}
int chkdir(dir d){
  if(d == UP) return y <= 0 ? 0 : su[x][y - 1] == 0;
  if(d == RIGHT) return x >= N - 1 ? 0 : su[x + 1][y] == 0;
  if(d == DOWN) return y >= N - 1 ? 0 : su[x][y + 1] == 0;
  return x <= 0 ? 0 : su[x - 1][y] == 0;
}
int ismove(void){return chkdir(UP) || chkdir(RIGHT) || chkdir(DOWN) || chkdir(LEFT);}
void move(dir d){d == UP ? y-- : d == RIGHT ? x++ : d == DOWN ? y++ : x--;}
void print(void){
  int i, j;
  for(i = 0; i < N; i++, putchar('\n'))
    for(j = 0; j < N; j++) putchar(i == x && j == y ? '*' : su[i][j] ? '+' : ' ');
}
int main(void){
  srand((unsigned int)time(NULL));
  x = nrand(N), y = nrand(N);
  su[x][y] = 1, print();
  while(ismove()){
    dir d = drand();
    su[x][y] = 1;
    if(chkdir(d)) move(d), print();
  }
  return 0;
}