#include"bits/stdc++.h" #include //#include using namespace std; #define print(x) cout<> s; int count[10] = {}; rep(i, 0, 10) { rep(j, 0, 200002) { if (i == s[j])count[i]++; } } int f, b; rep(i, 0, 10) { if (count[i] < a[i])b = i; else if (count[i] > a[i])f = i; } print(f << " " << b); }