LearnPy Hub
← Tuples & Sets problems
Medium

Set Commands

Start with an empty set. Read n commands: add x, discard x or has x. For has, print yes or no. At the end print the set sorted on one line (or empty).

Input

n, then n commands.

Output

Lines.

Sample 1

Input
5
add a
add b
has a
discard a
has a
Output
yes
no
b

Sample 2

Input
1
has z
Output
no
empty
solution.py
Output appears here
Set Commands · Python practice problem · LearnPy Hub