Output the date in the Mel calendar The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar.

This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last month. A year that is divisible by 4 but not by 100, or divisible by 400 has 366 days, and other years have 365 (i.e. our leap year rules, but with years in the Mel calendar).

You should use the month and day name abbreviations:

months: dia vio lis gil ful dyu mel ral zan pal mik fav ruj

days: dia vio lis gil ful dyu mel ral zan pal mik fav ruj ser rav tan lin rez jil din ket len lax nen pin mat kun mir

The extra days outside of any month have the month name of myuxet (no abbreviation here), and the day names are axet and teems, respectively.

0 dia dia is 1988/11/30.

You can take the input date as a string or a (year, month, day) tuple; alternatively, for functions, the parameter can be in your standard library's date type. The output should be a space-separated string.

Test cases

1776-07-04 =&gt; -213 ral ket
1859-12-15 =&gt; -129 dia rav
1917-04-14 =&gt; -72 ful nen
1981-02-04 =&gt; -8 lis mik
1988-11-30 =&gt; 0 dia dia
1988-12-01 =&gt; 0 dia vio
1988-12-28 =&gt; 0 vio dia
2017-01-01 =&gt; 28 vio ful
2019-04-22 =&gt; 30 dyu lis
2019-11-30 =&gt; 30 myuxet axet
2019-12-01 =&gt; 31 dia dia
2021-11-29 =&gt; 32 myuxet axet
2021-11-30 =&gt; 32 myuxet teems
2089-11-30 =&gt; 101 dia dia
2389-11-30 =&gt; 400 myuxet teems


You should be able to handle dates from 1 AD to 9999 AD at least.

Reference implementation in Perl 6

Standard loopholes are forbidden.
Perl 6, 174 bytes



{~(.year,(|[X]("diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".comb(3)xx 2)[^364],|("myuxet"X &lt;axet teems&gt;))[.day-of-year-1])}o*-726436


Try it online!

Generate a list of all the valid dates and then indexes the day of the year into that list.

Explanation

{                                                   }  # Anonymous code block
                                                     o*-726436  # Subtract some days from the input
  (.year,                               # Output the year
           [X]("...".comb(3))[^365]     # Then produce a list of all months/days
         (|                        ,
          |("myuxet"X &lt;axet teems&gt;))    # And the extra days
                                    [.day-of-year-1]   # And get the current date
 ~   # Stringify the list