import java.util.*;

public class store {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		HashSet<String> set = new HashSet<String>();

		int numCommands = stdin.nextInt();

		for (int loop=0; loop<numCommands; loop++) {

			char command = stdin.next().charAt(0);

			// Trying to add an item.
			if (command == 'a') {

				String item = stdin.next();

				if (set.contains(item))
					System.out.println(item+" is already in the set.");
				else {
					set.add(item);
					System.out.println(item+" has been added to the set.");
				}
			}

			else if (command == 'r') {

				String item = stdin.next();
				if (!set.contains(item))
					System.out.println("Can't remove "+item+". It's not in the set.");
				else {
					set.remove(item);
					System.out.println(item+" has been removed from the set.");
				}
			}

			else if (command == 's') {
				System.out.println("The set has "+set.size()+" number of items.");
			}

			else if (command == 'e') {
				set.clear();
				System.out.println("The set has been emptied.");
			}

			else if (command == 'c'){
				String item = stdin.next();

				if (set.contains(item))
					System.out.println("The set contains "+item+".");
				else
					System.out.println("The set does not contains "+item+".");

			}

			else if (command == 'p') {

				for (String item : set)
					System.out.println(item);
			}

		}
	}
}