Accordion#3674

Accordion

1 second
256 megabytes
Easy

Consider a sequence of characters made up of '[', ']', ':', and '|'. A valid sequence, which we will call a "bayan," starts with the character '[', followed by occurrences of ':', then occurrences of '|', followed again by occurrences of ':', and ends with the character ']' (X > 0, Y > 0).

Given a string composed of the characters '[', ']', ':', and '|', your task is to identify the longest substring of that forms a bayan.

A substring is defined as a sequence of consecutive characters within the string.

Input

The input consists of a single non-empty string , which includes the characters '[', ']', ':', and '|', and has a maximum length of .

Output

Output the longest substring of that qualifies as a bayan. If no such substring exists, output "][". In the case of multiple substrings of the same maximum length, choose the one containing the most '|' characters.

Examples

Example 1

Loading
Loading