#PCBTAM0000023. Gọt khoảng trắng hai đầu (Trim Outer Whitespace)

Gọt khoảng trắng hai đầu (Trim Outer Whitespace)

Trim Outer Whitespace

Version: Phuoc Hung OJ Extended

Problem Statement

Given one text line ss, remove all consecutive ASCII spaces (U+0020) and horizontal tabs (U+0009) from the beginning and end of the string. Preserve every character between the first and last non-whitespace characters, including internal spaces and tabs.

Report the length before trimming, the length after trimming, and the resulting string enclosed in | characters so an empty result is visible.

Input

One line contains ss, which may be empty or consist entirely of spaces and tabs. The line terminator is not part of ss.

Output

Print three lines: the original length; the trimmed length; and the trimmed string enclosed by | characters.

Subtasks

  • Subtask 1 (100 points): 0≤∣s∣≤1000\le |s|\le100; each character is printable ASCII or a U+0009 tab.

Examples

Example 1

Input

  A B  

Output

7
3
|A B|

Explanation. A B has length 77; trimming two spaces from each end leaves A B of length 33.

Example 2

Input

	 X	

Output

4
1
|X|

Explanation. The tab-space-X-tab input has length 44; trim the three outer whitespace characters to get X.

Example 3

Input

   

Output

3
0
||

Explanation. All three spaces are removed; the empty result has length 00 and is displayed as ||.