Under construction

Still being built. Things may change

School List

Time limit2sMemory limit1024 MB

Summary
Count registrations per school number parsed from each name, then list the numbers of schools with between one and five participants.
Level

Easy3 of 10

Topics
Hash map, String, Implementation
Solved
No attempts yet

Problem

When registering for an online olympiad, each participant fills in a form that includes the name of their school. Different participants may write the same school's name differently, for example Физико-математическая школа №18 and ФМШ №18. Digits in a school name appear only in the school number. The number appears exactly once in each name and uniquely identifies the school. A school number is a positive integer without leading zeros.

Write a program for the olympiad website that helps the organizers find the number of schools, and the numbers of those schools, from which between one and five participants registered.

Input

The first line contains one integer nn (1≤n≤10001 \le n \le 1000), the number of school names entered by all participants. Each of the next nn lines contains one school name. A name contains only uppercase and lowercase Latin letters, digits, and spaces, and its length does not exceed 100 characters.

Output

The first line contains one integer mm, the number of schools with between one and five registered participants. Each of the next mm lines contains one such school number, in any order.

Hint

In the sample, school 18 has two registered students, school 42 has one, and school 9 has six. So only schools 18 and 42 have between one and five participants.

Examples1

  1. Example 1

    Input
    9
    Physics and Mathematics School 18
    9ya shkola imeni Pushkina
    Lyceum 9
    PaMS 18
    Gymnasium 42
    School 9
    Shkola nomer 9
    High school 9
    School N 9
    
    Expected output
    2
    42
    18