u=gets.to_i;puts"%#{z=2+k=$_.size}s "*2%[u/9,'_'*k],"9 | #{u}",(6..z).map{|x|"%#{x}s "*3%[$_[0,2],"- %2d"%(u%9*9),'__']},"%*s"%[z,u%9]