#24. 字符串前缀拼接

    ID: 24 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatWarmup-1gesp3字符串

字符串前缀拼接

Triple Front

Background

In the world of string processing, sometimes we need to operate on specific parts of a string.

Problem Description

Given a string, we'll say that the front is the first 3 chars of the string. If the string length is less than 3, the front is whatever is there. Return a new string which is 3 copies of the front.

Input Format

Input is given from standard input in the following format.

A single line containing a string.

Output Format

Output is printed to standard output in the following format.

A single string, which is the result.

Sample

Java
JavJavJav
Chocolate
ChoChoCho
abc
abcabcabc

Sample Explanation

For the first sample, the input string is Java. Its length is greater than 3, so the "front" is the first 3 characters Jav. Repeating Jav 3 times gives JavJavJav.

Constraints

Time limit: 1 second per test case. Memory limit: 1024 KiB per test case.