#include <iostream>
#include <string>
using namespace std;
string findSubstring(string s) {
int n = s.length();
// 将字符串拼接自身并去掉首尾
string doubled = s + s;
string trimmed = doubled.substr(1, 2 * n - 2);
// 在处理后的字符串中查找原字符串
size_t pos = trimmed.find(s);
if(pos != string::npos && pos < n) {
return s.substr(0, pos + 1);
}
return "false";
}
int main() {
string s;
cin >> s;
cout << findSubstring(s) << endl;
return 0;
}
import java.util.Scanner;
public class Main {
public static String findSubstring(String s) {
int n = s.length();
// 将字符串拼接自身并去掉首尾
String doubled = s + s;
String trimmed = doubled.substring(1, 2 * n - 1);
// 在处理后的字符串中查找原字符串
int pos = trimmed.indexOf(s);
if(pos != -1 && pos < n) {
return s.substring(0, pos + 1);
}
return "false";
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
System.out.println(findSubstring(s));
}
}
def find_substring(s):
n = len(s)
# 将字符串拼接自身并去掉首尾
doubled = s + s
trimmed = doubled[1:2*n-1]
# 在处理后的字符串中查找原字符串
pos = trimmed.find(s)
if pos != -1 and pos < n:
return s[:pos+1]
return "false"
s = input()
print(find_substring(s))