#include <algorithm>
#include <iostream>
#include <map>
using namespace std;

int main() {
	const initializer_list<int> a[] = {{5, 7, 8}, {6, 6}, {}, {5, 6, 8, 9}};
	map<int, int> totals;
	
	for(const auto& i : a) for_each(cbegin(i), cend(i), [&](const auto& it){ totals[it]++;});

    cout << max_element(cbegin(totals), cend(totals), [](const auto& lhs, const auto& rhs){return lhs.second < rhs.second;})->first << endl;
}