#include <iostream>
using namespace std;
bool eqchar(string s)
{ // Проверка, является ли строка множеством одинаковых символов
for (int i = 0; i < s.length(); i++)
{
if (s[i] != s[0]) return false;
}
return true;
}
bool ispal(string s)
{ // Проверка, является ли строка палиндромом
for (int i = 0; i < s.length()/2; i++)
{
if (s[i] != s[s.length() - i - 1]) return false;
}
return true;
}
int main()
{
string s;
cin >> s;
if (eqchar(s)) cout << "NO SOLUTION";
else
{
if (!ispal(s))
{
cout << s;
}
else
{
if (s[0] < s[1]) cout << s.substr(0, s.length() - 1);
else cout << s.substr(1, s.length());
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKYm9vbCBlcWNoYXIoc3RyaW5nIHMpCnsJCS8vINCf0YDQvtCy0LXRgNC60LAsINGP0LLQu9GP0LXRgtGB0Y8g0LvQuCDRgdGC0YDQvtC60LAg0LzQvdC+0LbQtdGB0YLQstC+0Lwg0L7QtNC40L3QsNC60L7QstGL0YUg0YHQuNC80LLQvtC70L7QsgoJZm9yIChpbnQgaSA9IDA7IGkgPCBzLmxlbmd0aCgpOyBpKyspCgl7CgkJaWYgKHNbaV0gIT0gc1swXSkgcmV0dXJuIGZhbHNlOyAgCgl9CnJldHVybiB0cnVlOwp9Cgpib29sIGlzcGFsKHN0cmluZyBzKQp7CQkvLyDQn9GA0L7QstC10YDQutCwLCDRj9Cy0LvRj9C10YLRgdGPINC70Lgg0YHRgtGA0L7QutCwINC/0LDQu9C40L3QtNGA0L7QvNC+0LwKCWZvciAoaW50IGkgPSAwOyBpIDwgcy5sZW5ndGgoKS8yOyBpKyspCgl7CgkJaWYgKHNbaV0gIT0gc1tzLmxlbmd0aCgpIC0gaSAtIDFdKQlyZXR1cm4gZmFsc2U7Cgl9CglyZXR1cm4gdHJ1ZTsKfQoKaW50IG1haW4oKSAKewoJc3RyaW5nIHM7CgljaW4gPj4gczsKCWlmIChlcWNoYXIocykpIGNvdXQgPDwgIk5PIFNPT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