import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.container;
import std.datetime;

void main()
{
  int cnt;
  foreach (line; stdin.byLine) {
    if (cnt) writeln("");
    auto list = line.chomp.map!(a => a.to!char - '0').map!(to!int).array;
    string res[8];
    res[] = "";
    auto len = list.length;
    while (len < 5) {
      list = 0 ~ list;
      len++;
    }
    foreach (e; list) {
      if (e >= 5) {
        res[0] ~= ' ';
        res[1] ~= '*';
        e -= 5;
      } else {
        res[0] ~= '*';
        res[1] ~= ' '; 
      }
      int i;
      for (; i < e; i++) {
        res[i+3] ~= '*';
      }
      res[i+3] ~= ' ';
      foreach (j; i+1..5) {
        res[j+3] ~= '*';
      }
    }
    res[2] = "=====";
    foreach (e; res) {
      e.writeln;
    }
    cnt++;
  }
}