#C9766. Add Thousands Separators

    ID: 53895 Type: Default 1000ms 256MiB

Add Thousands Separators

Add Thousands Separators

Given a string representing a non-negative integer s, your task is to insert commas as thousands separators and output the resulting string. For example, if the input is 1234567, then the output should be 1,234,567.

The thousands separator should be inserted every three digits from the right. More formally, if the number has n digits, commas are inserted between the digits such that the last group (on the right) has exactly 3 digits (except possibly the first group, which may have fewer than 3 digits if n mod 3 ≠ 0).

Note: You should read input from standard input (stdin) and write output to standard output (stdout).

inputFormat

The input consists of a single line containing a string s which represents a non-negative integer. There will be no extra spaces in the input.

outputFormat

Output the string corresponding to the input, but with commas inserted as thousands separators. The output should be printed on a single line.

## sample
1234567
1,234,567