LearnPy Hub
← Arena
IntermediateRating 1200

Print a Month

Print a calendar for a month with n days whose first day is weekday d (1 = Monday ... 7 = Sunday). Each week is one line; each day is right-aligned in 3 characters; blank cells are 3 spaces. Trailing spaces may be omitted.

Input

n d.

Output

The weeks.

Sample 1

Input
31 3
Output
        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 2

Input
28 1
Output
  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
solution.py
Output appears here
Print a Month · Python Arena problem · LearnPy Hub