#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define all(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)< vi; typedef vector vvi; typedef vector vl; typedef vector vd; typedef pair pii; typedef pair pll; typedef long long ll; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int lcm(int a, int b) { return a / gcd(a, b) * b; } int extgcd(int a, int b, int& x, int& y) { int d = a; if (b != 0) { d = extgcd(b, a % b, y, x); y -= (a / b) * x; } else { x = 1; y = 0; } return d; } bool is_prime(ll n) { if (n == 2) return true; if (n % 2 == 0) return false; for (ll i = 3; i * i <= n; i+=2) { if (n % i == 0) return false; } return n != 1; } vector divisor(int n) { vector res; for (int i = 1; i * i <= n; i++) { if (n % i == 0) { res.pb(i); if (i != n / i) res.pb(n / i); } } return res; } map prime_factor(int n) { map res; for (int i = 2; i * i <= n; i++) { while (n % i == 0) { ++res[i]; n /= i; } } if (n != 1) res[n] = 1; return res; } const int MAX_N = 10000000; int prime[MAX_N]; bool memo[MAX_N + 1]; long long MOD = 1000000007ll; ll mod_pow(ll x, ll n, ll mod) { if (n == 0) return 1; ll res = mod_pow(x * x % mod, n / 2, mod); if (n & 1) res = res * x % mod; return res; } vector G[100005]; int dp1[1000005], dp2[100005]; void dfs(int p, int x) { vi child; for (int v : G[x]) { if (v != p) child.push_back(v); } for (int v : child)dfs(x, v); ll prod = 1; for (int v : child) prod = prod*dp1[v] % MOD; dp2[x] = prod; ll prod2 = 1; for (int v : child) prod2 = prod2*dp2[v] % MOD; dp1[x] = (dp2[x] + prod2) % MOD; } int trans(int n) { int ret = 0; while(n > 0) { ret += (n % 10)*(n % 10); n /= 10; } return ret; } int main() { int count2[10] = {}; int count[] = { 0,20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841 }; string inp; cin >> inp; P(inp.size()); rep(i,inp.size()) { if (inp[i] == '.')continue; int a2 = (int)(inp[i] - '0'); count2[a2]++; } int ans1=0, ans2=0; rep(i, 10) { if (count[i] > count2[i]) { ans1 = i; } if (count[i] < count2[i]) { ans2 = i; } } cout << ans2 << " " << ans1 << endl; return 0; }