#include <iostream>
#include <map>
int main()
{
std::map<int, std::size_t> counts;
int x;
while(std::cin >> x)
{
++counts[x]; //or: counts[x] = counts[x] + 1;
}
std::multimap<std::size_t, int> mode;
for(auto const &v : counts)
{
mode.emplace(v.second, v.first);
}
auto most = mode.rbegin()->first;
std::cout << "Appearing " << most << " times: ";
for(auto it = mode.rbegin(); it != mode.rend() && it->first == most; ++it)
{
std::cout << it->second << " ";
}
std::cout << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgoKaW50IG1haW4oKQp7CglzdGQ6Om1hcDxpbnQsIHN0ZDo6c2l6ZV90PiBjb3VudHM7CglpbnQgeDsKCXdoaWxlKHN0ZDo6Y2luID4+IHgpCgl7CgkJKytjb3VudHNbeF07IC8vb3I6IGNvdW50c1t4XSA9IGNvdW50c1t4XSArIDE7Cgl9CglzdGQ6Om11bHRpbWFwPHN0ZDo6c2l6ZV90LCBpbnQ+IG1vZGU7Cglmb3IoYXV0byBjb25zdCAmdiA6IGNvdW50cykKCXsKCQltb2RlLmVtcGxhY2Uodi5zZWNvbmQsIHYuZmlyc3QpOwoJfQoJYXV0byBtb3N0ID0gbW9kZS5yYmVnaW4oKS0+Zmlyc3Q7CglzdGQ6OmNvdXQgPDwgIkFwcGVhcmluZyAiIDw8IG1vc3QgPDwgIiB0aW1lczogIjsKCWZvcihhdXRvIGl0ID0gbW9kZS5yYmVnaW4oKTsgaXQgIT0gbW9kZS5yZW5kKCkgJiYgaXQtPmZpcnN0ID09IG1vc3Q7ICsraXQpCgl7CgkJc3RkOjpjb3V0IDw8IGl0LT5zZWNvbmQgPDwgIiAiOwoJfQoJc3RkOjpjb3V0IDw8IHN0ZDo6ZW5kbDsKfQo=