from collections import *
from itertools import *

def check(x):
    while (x > 0) and (x % 10 == 0):
        x //= 10
    v = str(x)
    return v == v[::-1]

def checkInter(x):
    if x == 0:
        return False
    return check(x - 1) and check(x + 1)

def toInt(v):
    r = 0
    for z in v:
        r = r * 10 + z
    return r

ans = set()

dn = 18

for i in range(0, dn + 1):
    ans.add(10 ** i)

for i in range(1, 10):
    ans.add(i)

for d in product([0, 2], repeat=dn - 1):
    x = toInt(list(d) + [1])
    if checkInter(x):
        ans.add(x)

for cd in range(1, dn):
    for d in product([7, 9], repeat=cd):
        x = toInt([8] + list(d))
        if checkInter(x):
            ans.add(x)


print(",\n".join(map(str, sorted(list(ans)))))
