#!/usr/bin/env python3 pi = [20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841] s = input() cnt = [s.count(str(i)) for i in range(10)] for i in range(10): if cnt[i] < pi[i]: y = i if cnt[i] > pi[i]: x = i print(x, y)