x,y =input().split()
if x == y:
    s = [x,x+y]
else:
    s = [x,y,x+y,y+x]
print(len(s))
for string in s:
    print(string)