codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

312A.md (1476B)


      1 Source: https://codeforces.com/problemset/problem/312/A
      2 
      3 A. Whose sentence is it?
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of his sentences. For each sentence in the chat record, help liouzhou_101 find whose sentence it is.
     22 
     23 Input
     24 
     25 The first line of the input contains an integer *n* (1 ≤ *n* ≤ 10), number of sentences in the chat record. Each of the next *n* lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
     26 
     27 Output
     28 
     29 For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG>.< I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditions.
     30 
     31 Examples
     32 
     33 Input
     34 
     35 ```
     36 5  
     37 I will go to play with you lala.  
     38 wow, welcome.  
     39 miao.lala.  
     40 miao.  
     41 miao .
     42 ```
     43 
     44 Output
     45 
     46 ```
     47 Freda's  
     48 OMG>.< I don't know!  
     49 OMG>.< I don't know!  
     50 Rainbow's  
     51 OMG>.< I don't know!
     52 ```