TIEBRKR - Tiebreaker

no tags 

Are you the winner? Let's find out in this tiebreaker.

Given a list of ticket numbers and the status of WIN or NOWIN, identify the winning tickets and output them in order from lowest to highest.

Input

An integer t, 1 <= t <= 100, denoting the number of tickets to check.

For each ticket, there are two lines with information. The first line is an integer n, which is the ticket number. The second line is s, the status of the ticket number. The ticket status is either WIN or NOWIN.

Output

One line that lists the number of winning tickets.

One line that lists the ticket numbers, sorted from highest to lowest. Each number is separated by a space.

Example

Input:
5
5011
WIN
4000
NOWIN
101
WIN
500
NOWIN
501
WIN Output: 3
101 501 5011


Added by:handee
Date:2021-06-26
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All