This page is still under construction.

Parts of this page are still being built. What you see may change.

Initial, Medial, Final

Time limit1sMemory limit256 MB

Summary
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 ㄱ, ㄲ, ㄳ, ㄴ, ㄵ, ㄶ, ㄷ, ㄹ, ㄺ, ㄻ, ㄼ, ㄽ, ㄾ, ㄿ, ㅀ, ㅁ, ㅂ, ㅄ, ㅅ, ㅆ, ㅇ, ㅈ, ㅊ, ㅋ, ㅌ, ㅍ, ㅎ.

Examples4

  1. Example 1

    Input
    가
    
    Expected output
    ㄱ
    ㅏ
    
    
  2. Example 2

    Input
    닭
    
    Expected output
    ㄷ
    ㅏ
    ㄺ
    
  3. Example 3

    Input
    백
    
    Expected output
    ㅂ
    ㅐ
    ㄱ
    
  4. Example 4

    Input
    준
    
    Expected output
    ㅈ
    ㅜ
    ㄴ