#!/usr/bin/env python3
import sys

Digits = [
	[" *** ", "*   *", "*   *", "*   *", "*   *", "*   *", " *** "], # Zero
	["  *  ", "  *  ", "  *  ", "  *  ", "  *  ", "  *  ", "*****"], # One
	[" *** ", "*   *", "    *", "   * ", "  *  ", " *   ", "*****"], # Two
	[" *** ", "*   *", "   * ", " *** ", "    *", "*   *", " *** "], # Three
	["*   *", "*   *", "*   *", " ****", "    *", "    *", "    *"], # Four
	[" ****", "*    ", "*    ", "**** ", "    *", "    *", "**** "], # Five
	[" ****", "*    ", "*    ", "*****", "*   *", "*   *", "**** "], # Six
	["**** ", "    *", "    *", "  ***", "    *", "    *", "    *"], # Seven
	[" *** ", "*   *", "*   *", " *** ", "*   *", "*   *", " *** "], # eigth
	[" *** ", "*   *", "*   *", " ****", "    *", "    *", "    *"] # Nine
]

try:
	digits = sys.argv[1:]
	row = 0
	while row < 7:
		line = ""
		column = 0
		while column < len(digits):
			number = int(digits[column]) #Check if the number is right
			digit = Digits[number]
			line += digit[row] + " "
			column += 1
		print(line)
		row += 1
except IndexError:
	print("No is in range")
except ValueError as err:
	print(err, "in", digits)