\documentclass{article}

% Macros to make this problem look like the rest of our problems.
\usepackage{icpc_problem}

% Title of your problem.
\title{Get Set!}

% Who made the problem
\author{David Sturgill}

% Keywords, from a set of standard keywords.
\keywords{simple}

% Anything you want to say about the problem, including how one could solve it
\comments{We often use this problem for a practice problem
in local contests.}

% Difficulty on a 1..10 scale.
\difficulty{1}

\begin{document}

\begin{problemDescription}
This is an exercise with sets.  Simply devising the data structures 
and algorithms to do it is sufficient.  Concern about time efficiency is not.
The idea is to build and manipulate sets.  Submit your solution under
the file name {\em GetSet} with the appropriate language extension.
\end{problemDescription}

\begin{inputDescription}
The input consists of a sequence of at most 99 commands, one per line,
ending with a line containly only the word ``stop'' (and perhaps a new
line character).  Each command line begins with one of the words 
in the following list. All commands in the input will be legal and
executable.  The stack is initially empty.  The sequence may end with 
sets still in the stack.

\begin{description}
\vspace{-.1in}
\item[set -] The positive integers that follow define a new set.  Add it
  to the stack of previously defined sets.  There will be at most 10
  integers for the new set.
\vspace{-.1in}
\item[union -] Replace the top two sets on the stack with their union.
\vspace{-.1in}
\item[intersect -] Replace the top two sets on the stack with their intersection.
\vspace{-.1in}
\item[diff -] Replace the top two sets on the stack with their set difference
  (the topmost minus the next to the top).
\vspace{-.1in}
\item[symdiff -] Replace the top two sets on the stack with their symmetric
 difference.
\vspace{-.1in}
\item[sub -] Move to the top of the stack the highest set that is a proper
  subset of the top set.
\vspace{-.1in}
\item[super -] Move to the top of the stack the highest set that is a proper
  superset of the top set. 
\vspace{-.1in}
\item[dup -] Duplicate the set at the top of the stack.
\vspace{-.1in}
\item[swap -] Swap the top two sets on the stack.
\vspace{-.1in}
\item[rot -] Rotate the top three sets on the stack, bringing to the top the
  third set down.
\vspace{-.1in}
\item[print -] Pop and print the set at the top of the stack.
\vspace{-.1in}
\end{description}
\end{inputDescription}
\begin{outputDescription}
Output occurs with each ``print'' command.  Enumerate and format as in the
example.  Spacing is important.  Elements should always be in sorted order.
\end{outputDescription}

\begin{sampleInput}
set 2 6 4 3 1
dup
set 1 3 5 7
dup
rot
union
diff
super
print
print
stop
\end{sampleInput}
\begin{sampleOutput}
1. [1 2 3 4 6]
2. [2 4 6]
\end{sampleOutput}

\end{document}
