CodeLab Academy 📞 9936 6696
← List Python · Level 9: Functions and dicts Code · 90 points ← #815 #817 →

#816. Warehouse

You get commands: `add item k` (add k pieces) and `remove item k` (take away k pieces, but never below 0). At the end, print the items that have more than 0 left as `item count`, in alphabetical order. If nothing is left, print `Empty`. ### Input n, then n lines with commands. ### Output Lines.

Examples

Input
4
remove book 6
add ball 2
add pen 6
remove pen 6
Output
ball 2
Input
8
add pen 9
remove pen 5
add book 2
remove book 1
add book 9
add ball 8
add book 3
add pen 7
Output
ball 8
book 13
pen 11

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!