{"problem":{"name":"L. Emoticons","description":{"content":"Bob has received a text message from his girlfriend Alice. The message consists only of colons (\"_:_\") and brackets (\"_(_\" and \"_)_\"). Two consecutive characters in the message form an emoticon if one","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10079L"},"statements":[{"statement_type":"Markdown","content":"Bob has received a text message from his girlfriend Alice. The message consists only of colons (\"_:_\") and brackets (\"_(_\" and \"_)_\"). Two consecutive characters in the message form an emoticon if one of them is a colon and the other one is a bracket. If the bracket's inner side faces the colon, the emoticon is a smiley; otherwise it is a frowney. So, \"_:)_\" and \"_(:_\" are smilies, and \"_:(_\" and \"_):_\" are frownies. One character can belong to two emoticons: for example, there are both a smiley and a frowney in the message \"_):)_\".\n\nUnfortunately, Bob has trouble understanding the message. He can only find out Alice's mood based on the number of emoticons in the message: \n\nHelp Bob determine how does Alice feel!\n\nThe first line contains a single integer n, the length of the message (1 ≤ n ≤ 105). The next line contains the message, a string consisting of n characters. Each of the characters is either \"_:_\", \"_(_\" or \"_)_\".\n\nIn a single line, output either \"_HAPPY_\", \"_BORED_\" or \"_SAD_\" corresponding to Alice's mood.\n\n## Input\n\nThe first line contains a single integer n, the length of the message (1 ≤ n ≤ 105). The next line contains the message, a string consisting of n characters. Each of the characters is either \"_:_\", \"_(_\" or \"_)_\".\n\n## Output\n\nIn a single line, output either \"_HAPPY_\", \"_BORED_\" or \"_SAD_\" corresponding to Alice's mood.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the length of the message.  \nLet $ s = s_1 s_2 \\dots s_n $ be a string over the alphabet $ \\{ \\texttt{:}, \\texttt{(}, \\texttt{)} \\} $.\n\n**Constraints**  \n$ 1 \\le n \\le 10^5 $\n\n**Definitions (Emoticons)**  \nFor each $ i \\in \\{1, \\dots, n-1\\} $, the pair $ (s_i, s_{i+1}) $ forms an emoticon if one character is `:` and the other is `(` or `)`.  \n- It is a **smiley** if: $ (s_i, s_{i+1}) = (\\texttt{:}, \\texttt{)}) $ or $ (s_i, s_{i+1}) = (\\texttt{(}, \\texttt{:}) ) $  \n- It is a **frowney** if: $ (s_i, s_{i+1}) = (\\texttt{:}, \\texttt{(}) $ or $ (s_i, s_{i+1}) = (\\texttt{)}, \\texttt{:}) ) $\n\nLet:  \n- $ H = \\# \\{ i \\in \\{1, \\dots, n-1\\} \\mid (s_i, s_{i+1}) \\text{ is a smiley} \\} $  \n- $ F = \\# \\{ i \\in \\{1, \\dots, n-1\\} \\mid (s_i, s_{i+1}) \\text{ is a frowney} \\} $\n\n**Objective**  \nOutput:  \n- $ \\texttt{HAPPY} $ if $ H > F $  \n- $ \\texttt{SAD} $ if $ H < F $  \n- $ \\texttt{BORED} $ if $ H = F $","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10079L","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}