import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
public static boolean eqchar
(String s
) {
for (int i = 1; i < s.length(); i++)
{
if (s.charAt(i) != s.charAt(0)) return false;
}
return true;
}
public static boolean ispal
(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 (eqchar
(s
)) System.
out.
println("NO SOLUTION"); else
{
if (!ispal
(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)); }
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgYm9vbGVhbiBlcWNoYXIoU3RyaW5nIHMpCgl7CgkJZm9yIChpbnQgaSA9IDE7IGkgPCBzLmxlbmd0aCgpOyBpKyspCgkJewoJCQlpZiAocy5jaGFyQXQoaSkgIT0gcy5jaGFyQXQoMCkpIHJldHVybiBmYWxzZTsKCQl9CgkJcmV0dXJuIHRydWU7Cgl9CgoJcHVibGljIHN0YXRpYyBib29sZWFuIGlzcGFsKFN0cmluZyBzKQoJewoJCWZvciAoaW50IGkgPSAwOyBpIDwgcy5sZW5ndGgoKS8yOyBpKyspCgkJewoJCQlpZiAocy5jaGFyQXQoaSkgIT0gcy5jaGFyQXQocy5sZW5ndGgoKSAtIGkgLSAxKSkgcmV0dXJuIGZhbHNlOwoJCX0KCQlyZXR1cm4gdHJ1ZTsKCX0KCQoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU2Nhbm5lciBpbj1uZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCVN0cmluZyBzID0gaW4ubmV4dExpbm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