Problem Link
This is a very bruteforce problem. Just maintain a hash map and then bruteforce all operations. Just becareful and avoid hash collisions with whatever you want.