
import std.stdio, std.math;

int[] to_array(int n) {
  int[] res;
  for(size_t i = n; i > 0; i /= 10) res ~= i % 10;
  for(size_t i = 5 - res.length; i > 0; i--) res ~= 0;
  return res.reverse;
}

void main() {
  bool f = true;
  for(int num; readf("%d\n", &num);) {
    if (f) f = false;
    else writeln;
    int[] arr = to_array(1111);
    for(int i = 1; i >= 0; i--) {
      for(int j = 0; j <= 4; j++) {
        if ((arr[j] > 4) ^ i) write("*");
        else write(" ");
      }
      writeln;
    }
    writeln("=====");
    for(int i = 0; i <= 4; i++) {
      for(int j = 0; j <= 4; j++) {
        if (i == (abs((arr[j] > 4 ? arr[j] - 5 : arr[j]) % 5))) write(" ");
        else write("*");
      }
      writeln;
    }
  }
}