a, b = map(int, open('candies.in').read().split())
assert 1 <= a <= 10**9
assert 1 <= b <= 10**9
out = open('candies.out', 'w').write

sa = list(str(a))
sb = list(str(b))

if len(sa) < len(sb) or a == b:
    out('Bad luck\n')
elif len(sa) > len(sb):
    out('0\n')
else:
    i = 0
    while sa[i] == sb[i] and i < len(sa):
        i += 1
    if i == len(sa):
        out('Bad luck\n')
    elif (sa[i] > sb[i]):
        out('0\n')
    else:
        out('1\n%d\n'%(i + 1))
