TSOC '16 Contest 2 #1 - Mary, Jane and Invitations

View as PDF

Submit solution

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

Authors:
Problem type

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 \le N \le 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 the names of guests.

Output Specification

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

Sample Input

7
AORRROXXXAO
Miranda
Jonathan
Melina
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 Jonathan, beloved occasion enthusiast, come to my crib to celebrate this very special day.
Dear Melina, 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. 25, 2017, 1:33 a.m. edited

    Is there anything like this? AXOXAXOXAXO or AXOXXXR


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

    e.g. could AAXOXXO replace the first X?


    • 1
      bobhob314  commented on April 20, 2016, 10: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