Eight Trigrams (1 Point)

View as PDF

Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

Problem Statement

Neji Hyuga was studying triagrams and palms, which are three letter words. You have been asked to do the question which Neji could not do.

Given a string s of length 3 (i.e. a trigram), and a positive integer n, create a string such that it contains s in n different places, and it is as small as possible. It can be proven there is exactly one unique string with these properties.

Input Format

Your first line will contain n. Your next line will contain s.

Output Format

You should output the smallest string containing s in n different places.

Constraints

  • 1 \leq n \leq 10^4

Sample Cases

Input 1
5
ana
Output 1
ananananana
Input 2
3
abc
Output 2
abcabcabc

Comments

There are no comments at the moment.