1. 비슷한 문자열

a = input()
b = input()
d = 0

for i in range(len(a)):
    if a[i] != b[i]:
        d += 1

if a[0] == b[0] and a[-1] == b[-1] and d <= 1:
    print(1)
else:
    print(0)

2. 교집합 합집합

set(map(int, input().split()))
a = set(map(int, input().split()))
b = set(map(int, input().split()))

c = sorted(a & b)
d = sorted(a | b)

if not c:
    print('empty')
else:
    for i in c:
        print(i, end=' ')
    print()

for i in d:
    print(i, end=' ')

3. 도서관