Mary, Jane and Invitations

View as PDF

Submit solution

Points: 4
Time limit: 2.0s
Memory limit: 256M

Authors:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Mary is hosting her annual party for April 20th to appreciate this very special day. She needs your help to make a mailing service to send invites to up to 500 guests of this great annual party. Her friend Jane has promised to take care of the actual mailing service and you only need to make a program that generates the invites.

Mary will need 3 types of invites for new artists, new occasion enthusiasts and returning guests. She will let you know what type of invite she wants for each of her guests by a string consisting of letters A (New Artist), O (New Occasion Enthusiast), R (Returning guest), and X for when she makes a mistake. The number of contiguous Xs represents how many characters ago she made a mistake and the following letter will be what replaces it. Note that she corrects a mistake immediately after writing the Xs required, and any following corrections will refer to the corrected string.

These are the 3 types of invites she would like you to issue:

  • New Artist: Dear [name], beloved artist, I would love to have you at my party. Come to my crib on April 20th.
  • New Occasion Enthusiast : Dear [name], beloved occasion enthusiast, come to my crib to celebrate this very special day.
  • Returning Guest : Dear [name], April 20th is happening again this year. Don't miss out.

Input Specification

The first line of input will consist of an integer N ( 1 \leq N \leq 500) representing the number of guests invited.

The second line of input will consist of an uppercase string S letting you know what type of invite she needs. Note that it is not guaranteed that N = |S|!

The next N lines will consist of names of guests.

Output Specification

Output N lines of invitations for all guests, in order of input.

Sample Input

7
AORRROXXXAO
Miranda
Johnathan
Mellina
Jason
Mark
Jina
Walid

Sample Output

Dear Miranda, beloved artist, I would love to have you at my party. Come to my crib on April 20th.
Dear Johnathan, beloved occasion enthusiast, come to my crib to celebrate this very special day.
Dear Mellina, April 20th is happening again this year. Don't miss out.
Dear Jason, beloved artist, I would love to have you at my party. Come to my crib on April 20th.
Dear Mark, April 20th is happening again this year. Don't miss out.
Dear Jina, beloved occasion enthusiast, come to my crib to celebrate this very special day.
Dear Walid, beloved occasion enthusiast, come to my crib to celebrate this very special day.

Comments


  • 0
    1419903188  commented on Sept. 24, 2017, 9:33 p.m. edited

    Is there anything like this? AXOXAXOXAXO or AXOXXXR


  • 1
    qweqweqweqweqwe123123  commented on April 21, 2016, 5:49 p.m.

    Johnathan -> Jonathan Mellina -> Melina


    • 0
      bobhob314  commented on April 21, 2016, 7:29 p.m. edit 4

      Nice find, I think my co-problemsetter may have been enjoying 420 a little too much that day... :) Could the admins please edit the problem? (Last time I changed the problem during a contest, I got banned)

      @thomas0115: Nice 1h30min solve time + 15 submissions ;)


      • 0
        Xyene  commented on April 21, 2016, 7:38 p.m.

        Fixed!


  • 0
    Zander  commented on April 20, 2016, 5:07 p.m.

    e.g. could AAXOXXO replace the first X?


    • 2
      bobhob314  commented on April 20, 2016, 6:46 p.m.

      No, X's are never replaced.

      Note that she corrects a mistake immediately after writing the Xs required, and any following corrections will refer to the corrected string.

      <3