#include <iostream>
using namespace std;
bool check(int x)
{
string s;
for (; x; x /= 10) s += (x % 10 + '0');
for (int i = 0, j = s.size() - 1; i < j; i ++, j -- )
if (s[i] != s[j]) return false;
return true;
}
int main()
{
for (int i = 1; i < 256; i ++ )
...