
from yogi import *

for n in tokens(int):
    b = read(int)
    print(n, b, 1 if tres_digits_seguits_iguals(n, b) else 0)
