A = [20104,20063,19892,20011,19874,20199,19898,20163,19956,19841] B = [0] * 10 S = input() for s in S: if s != ".": B[int(s)] += 1 for i in range(10): if A[i] < B[i]: x = i if A[i] > B[i]: y = i print(x,y)