
Magdalena likes calendars, and she makes her own calendar for each month.
Each day of the month is represented with exactly three characters:
- If the day number is single-digit, then it is represented as
..X
. For example, the number is represented as..7
. - If the day number is double-digit, then it is represented as
.XY
. For example, the number is represented as.17
.
Each row of the calendar represents a week, and each week consists of ...
.
Magdalena also wants her calendar to be pretty. She will decorate it in the following way: she will fill
the upper and lower sides with -
(ASCII 45), the left and right sides with |
(ASCII 124), and the
corners with +
(ASCII 43).
For example, the format of Magdalena's calendar, when the month has
+---------------------+
|........1..2..3..4..5|
|..6..7..8..9.10.11.12|
|.13.14.15.16.17.18.19|
|.20.21.22.23.24.25.26|
|.27.28.29.30.31......|
+---------------------+
Your task is to determine the format of Magdalena's calendar if it has
Note: We assume the first day of the week is Monday.
Input Specification
The first and only line contains integers
Output Specification
Print Magdalena's calendar.
Constraints
Subtask | Points | Constraints |
---|---|---|
1 | 7 | All the days will fit in a row. |
2 | 19 | |
3 | 24 | No additional constraints. |
Sample Input 1
31 3
Sample Output 1
+---------------------+
|........1..2..3..4..5|
|..6..7..8..9.10.11.12|
|.13.14.15.16.17.18.19|
|.20.21.22.23.24.25.26|
|.27.28.29.30.31......|
+---------------------+
Sample Input 2
1 5
Sample Output 2
+---------------------+
|..............1......|
+---------------------+
Explanation for Sample 2
Note that although there is only one day in the month, the calendar still has the format of seven days per row.
Sample Input 3
28 7
Sample Output 3
+---------------------+
|....................1|
|..2..3..4..5..6..7..8|
|..9.10.11.12.13.14.15|
|.16.17.18.19.20.21.22|
|.23.24.25.26.27.28...|
+---------------------+
Comments