Extend the first function by creating a class object that allows for iterative adding of ids to a dynamic array while also tracking the number of times a given id has flipped between even and odd occurrences.
Implement process_operations(operations), which uses your class to process add, flips, and ids operations. An identifier's first occurrence is odd, its second is even, and every later occurrence changes parity and increments its flip count. Return query results in order.
def process_operations(operations):