#include <iostream>
#include <vector>
#include <unordered_set>
#include <string>
#include<sstream>
using namespace std;
int main() {
    string n;
    getline(cin, n);
    vector<string> prices;
    string input;
    getline(cin, input);
    istringstream iss(input);
    string price;
    while (iss >> price) {
        prices.push_back(price);
    }
    unordered_set<string> repeated_elements;
    for (const auto& element : prices) {
        if (count(prices.begin(), prices.end(), element) >= stoi(n) && repeated_elements.find(element) == repeated_elements.end()) {
            repeated_elements.insert(element);
        }
    }
    cout << repeated_elements.size() << endl;
    for (const auto& element : repeated_elements) {
        cout << element << " ";
    }
    cout << endl;
    return 0;
}

