#C13263. Word Frequency Counter

    ID: 42782 Type: Default 1000ms 256MiB

Word Frequency Counter

Word Frequency Counter

You are given a text string. Your task is to count the frequency of each unique word in the string. The matching is case-insensitive and all punctuation should be ignored. A word is defined as any contiguous sequence of alphanumeric characters.

After counting, print each unique word along with its frequency, one pair per line. The output should be sorted in lexicographical order by the word.

Note: All formulas or patterns (such as regex) should be treated in LaTeX format if referenced. For example, the word extraction pattern can be expressed as: \(\\texttt{\\b\\w+\\b}\).

inputFormat

The input is read from stdin and consists of a single line containing a string that may include letters, digits, spaces, and punctuation.

outputFormat

The output should be printed to stdout and consist of several lines. Each line contains a word and its frequency separated by a space. The words must be output in lexicographical (alphabetical) order.

## sample
hello world
hello 1

world 1

</p>