#!/usr/bin/env python3 # -*- coding: utf-8 -*- import collections import string PI200K = {'0': 20104, '1': 20063, '2': 19892, '3': 20011, '4': 19874, '5': 20199, '6': 19898, '7': 20163, '8': 19956, '9': 19841} def compare_strings(wrong, correct=PI200K): wrong_counter = collections.Counter(wrong) for d in string.digits: if PI200K[d] < wrong_counter[d]: before = d elif PI200K[d] > wrong_counter[d]: after = d return [before, after] def main(): print(" ".join(compare_strings(input()))) if __name__ == "__main__": main()