Display a tally (in varying bases) Tallying is a simple counting system that works in base 5. There are various different tallying systems used around the world, but the one that is used in most English-speaking countries is perhaps the most simple - count units by marking vertical lines, then for each 5th mark put a horizontal line through the previous collection of four. This clusters the tally marks in groups of 5 (and makes them easier to quickly count).

You are going to write a program that displays tally marks up to a given value. But, tallying in only base 5 is boring! Therefore, your program should also be able to display tallies in different bases.

Input

The input will be either one or two non-negative integer values separated by a comma (e.g. 9 or 8,4). The first number is the value that should be displayed by the tally. The second value is the base of the tally. If the second value is not given, use base 5.

Output

The output will be the inputted value represented as ASCII art tally marks. Here are some examples you can test your program against - your output should match them exactly!

Input: 12 or 12,5

 | | | |   | | | |   | |
-+-+-+-+- -+-+-+-+-  | |
 | | | |   | | | |   | |


Input: 7,3

 | |   | |   |
-+-+- -+-+-  |
 | |   | |   |


Input: 4,2

 |   |
-+- -+-
 |   |


Input: 6,1 or 6,10 (notice the leading spaces)

 | | | | | |
 | | | | | |
 | | | | | |


Note also that base 1 is intended to be inconsistent - only vertical lines should be used.

If either of the inputted values is 0, there should be no output whatsoever (and your program should end gracefully).

Rules


This is code-golf, so the shortest correct implementation (in bytes) wins.
Input/output can be in any suitable medium (e.g. stdin/stdout, file...).
Input can be in the form of multiple command-line arguments or separated by spaces, etc. if it is more suitable for your target language.
Trailing newlines are allowed in the output. Trailing spaces are not. This rule only applies when there is an output (i.e. not when the inputted value is 0).
Your code must default to base 5 when no base is input.
Python 2 - 111 108 119 144 140 136 135 134 - Try it

Ok, let's give it a try:

i=input()
n,b=[(i,5),i][i&gt;[]]
o=b-1
a=[n,n%b][b&gt;1]*' |'
m=(b&gt;1)*n/b
s=(' |'*o+'  ')*m+a
print(s+'\n'+('-+'*o+'- ')*m+a+'\n'+s)*(b*n&gt;0)


Edit: I've overlooked that there should be no output if n==0 or b==0. This costs me 11 characters. :(

Edit: Ok, after fixing the second issue mentioned in the comments my solution basically converged to the one from BeetDemGuise.