Bureaucracy

Time limit3sMemory limit256 MB

Problem

Long ago, in a distant kingdom, the king decided to keep a record of every law in his realm. From that moment on, whenever a new law was passed, a matching entry was added to the law archive.

Many centuries later, scholars discovered that the kingdom had only two kinds of laws:

  • a direct law, which establishes a new rule;
  • a canceling law, which cancels one earlier law.

A law is considered active if and only if no active law cancels it.

Write a program that determines which laws are still active.

Input

The first line contains an integer $1 \le n \le 100,000$, the number of laws that were passed.

Each of the next $n$ lines describes one law, in one of the following two formats:

  • declare --- a direct law was passed.
  • cancel $i$ --- this canceling law cancels law number $i$, which is one of the earlier laws.

Laws are numbered starting from 1, in the order in which they appear.

Output

On the first line, print the number of active laws. On the next line, print the numbers of the active laws in increasing order, separated by single spaces.