#include<bits/stdc++.h>
using namespace std;
map<int,int>mp;
int main()
{
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n,m;cin >> n>>m;
for(int i = 1; i <= n * m; i++)
{
int x;cin >> x;
mp[x]++;
}
//for(auto &i : mp)
//{
// if(i.second > n * m / 2) cout << i.first << '\n';
//}
for (const auto &[x,y] : mp)
{
if ( 2 * y > n * m)
cout << x << '\n';
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
map<int,int>mp;
set<int> s;
int n, m;
bool check(int cnt)
{
if (cnt > n*m / 2)
return true;
return false;
}
int main()
{
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
cin >> n >> m;
int num;
for (int i = 1; i <= n*m ;i++)
{
cin >> num;
s.insert(num);
mp[num]++;
}
for (auto& j : s)
{
if(check(mp[j]))cout << j << '\n';
}
return 0;
}