# Arup Guha
# 4/8/2025
# Solution to Kattis Problem: Same Digits (Hard)
# https://open.kattis.com/problems/samedigitshard

# Returns all solutions that equal a product n, with all 3 items within s and e.
def sol(n,s,e):

    # Store answers here.
    res = []

    # We can just start at the smallest possible value.
    i = s

    # Do a divisibility check AND bounds check...
    while i*i <= n:
        if n%i == 0 and i >= s and i <= e and n//i >= s and n//i <= e and check(i, n//i, n):
            res.append([i,n//i,n])
        i += 1

    return res

# Checks if the digit preservation is occurring
def check(a,b,c):

    # Frequency array for digits in a and b.
    freqab = []
    for i in range(10):
        freqab.append(0)

    # Add in a's digits.
    while a > 0:
        freqab[a%10] += 1
        a = a//10

    # And b's digits.
    while b > 0:
        freqab[b%10] += 1
        b = b//10

    # Do c's digits.
    freqc = []
    for i in range(10):
        freqc.append(0)
    while c > 0:
        freqc[c%10] += 1
        c = c//10

    # If anything doesn't match we're not good.
    for i in range(10):
        if freqab[i] != freqc[i]:
            return False

    # We're good if we make it here.
    return True

# Get input.
toks = input().split()
s = int(toks[0])
e = int(toks[1])
res = []

# Run each integer in range.
for loop in range(s, e+1):
    tmp = sol(loop,s,e)
    for x in tmp:
        res.append(x)

# Sort it the way they want.
if len(res) > 0:
    res.sort()

# Output.
print(len(res),"digit-preserving pair(s)")
for item in res:
    print("x = ",item[0],", y = ", item[1], ", xy = ", item[2], sep="")
