P26481 [AtCoder] camel_case
普及+
题目描述

Problem Description

Define "camel case string" and "underscore-separated string" as follows:

  • Word: A string starting with a lowercase English letter, consisting of lowercase English letters and/or digits.
  • Camel case string: A string formed by concatenating one or more words, with the first letter of each word (except the first word) capitalized.
  • Underscore-separated string: A string formed by concatenating one or more words, separated by a single underscore.

Additionally, after concatenation, one or more underscores may be added at the beginning or end of a camel case string or underscore-separated string.

Given a string, convert it between camel case and underscore-separated string. The added leading and trailing underscores should be preserved. If the string is neither camel case nor underscore-separated, output the given string as is. It is guaranteed that for strings that can be interpreted as both camel case and underscore-separated, the result of the conversion will be the same regardless of the interpretation.

The input is given from standard input in the following format:

$ c_1c_2…c_N $

  • The input consists of a single line containing the string.
  • The length of the input string $ N $ satisfies $1 \leq N \leq 50$.
  • Each character $ c_i $ is either an uppercase alphabet (A, …, Z), a lowercase alphabet (a, …, z), a digit (0, …, 9), or an underscore (_).

Output the converted string from the given input in one line to standard output. A newline is required at the end of the line.

Input Format

None

Output Format

None

Sample Input and Output

Sample Input #1

lower_camel_case

Sample Output #1

lowerCamelCase

Sample Input #2

_snakeCase_

Sample Output #2

_snake_case_

Sample Input #3

KLab

Sample Output #3

KLab

Sample Input #4

_

Sample Output #4

_

Sample Input #5

a_bc_9a_b

Sample Output #5

a_bc_9a_b

Notes/Hints

None

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
lower_camel_case
样例输出
lowerCamelCase