import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
public static boolean Function
(String s
) {
for (int i = 1; i < s.length(); i++)
{
if (s.charAt(i) != s.charAt(0)) return false;
}
return true;
}
public static boolean palindrom
(String s
) {
for (int i = 0; i < s.length()/2; i++)
{
if (s.charAt(i) != s.charAt(s.length() - i - 1)) return false;
}
return true;
}
{
Scanner in
=new Scanner
(System.
in); if (Function
(s
)) System.
out.
println("NO SOLUTION"); else
{
if (!palindrom
(s
)) System.
out.
println(s
); else
{
if (s.
charAt(0) < s.
charAt(1)) System.
out.
println(s.
substring(0, s.
length() - 1)); else System.
out.
println(s.
substring(1)); }
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CiAKY2xhc3MgTWFpbgp7CglwdWJsaWMgc3RhdGljIGJvb2xlYW4gRnVuY3Rpb24oU3RyaW5nIHMpCgl7CgkJZm9yIChpbnQgaSA9IDE7IGkgPCBzLmxlbmd0aCgpOyBpKyspCgkJewoJCQlpZiAocy5jaGFyQXQoaSkgIT0gcy5jaGFyQXQoMCkpIHJldHVybiBmYWxzZTsKCQl9CgkJcmV0dXJuIHRydWU7Cgl9CiAKCXB1YmxpYyBzdGF0aWMgYm9vbGVhbiBwYWxpbmRyb20oU3RyaW5nIHMpCgl7CgkJZm9yIChpbnQgaSA9IDA7IGkgPCBzLmxlbmd0aCgpLzI7IGkrKykKCQl7CgkJCWlmIChzLmNoYXJBdChpKSAhPSBzLmNoYXJBdChzLmxlbmd0aCgpIC0gaSAtIDEpKSByZXR1cm4gZmFsc2U7CgkJfQoJCXJldHVybiB0cnVlOwoJfQogCglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlTY2FubmVyIGluPW5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJU3RyaW5nIHMgPSBpbi5uZXh0TGlu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