Initial, Medial, Final
Time limit1sMemory limit256 MB
Decompose one Hangul syllable into its initial, medial, and optional final jamo and print each on its own line.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
One Hangul syllable is given. Write a program that decomposes the syllable into its initial consonant, medial vowel, and final consonant.
Input
The first line contains one character. The character is always a Hangul syllable in the Unicode range U+AC00 to U+D7A3, encoded in UTF-8.
Output
Print the initial on the first line, the medial on the second line, and the final on the third line. When the syllable has no final, leave the third line empty.
The initial is one of ㄱ, ㄲ, ㄴ, ㄷ, ㄸ, ㄹ, ㅁ, ㅂ, ㅃ, ㅅ, ㅆ, ㅇ, ㅈ, ㅉ, ㅊ, ㅋ, ㅌ, ㅍ, ㅎ.
The medial is one of ㅏ, ㅐ, ㅑ, ㅒ, ㅓ, ㅔ, ㅕ, ㅖ, ㅗ, ㅘ, ㅙ, ㅚ, ㅛ, ㅜ, ㅝ, ㅞ, ㅟ, ㅠ, ㅡ, ㅢ, ㅣ.
The final is one of ㄱ, ㄲ, ㄳ, ㄴ, ㄵ, ㄶ, ㄷ, ㄹ, ㄺ, ㄻ, ㄼ, ㄽ, ㄾ, ㄿ, ㅀ, ㅁ, ㅂ, ㅄ, ㅅ, ㅆ, ㅇ, ㅈ, ㅊ, ㅋ, ㅌ, ㅍ, ㅎ.