import random

class RandomizedSet:
    def __init(self):
        self.mapping = {}
        self.items = []
    
    def insert(self, value):
        if value not in self.mapping:
            self.items.append(value)
            self.mapping[value] = len(self.items) - 1
            return True
        return False
    
    def remove(self, value):
        if value not in self.mapping:
            return False
        index = self.mapping[value]
        self.items[index] = self.items[-1]
        self.mapping[self.items[index]] = index
        self.items.pop()
        del self.mapping[value]
        return True
    
    def get_random(self):
        index = random.randint(0, len(self.items) - 1)
        return self.items[index]

class RandomizedSet2:
    def __init__(self):
        self.mapping = {}
        self.items = []
    
    def insert(self, value):
        if value not in self.mapping:
            self.items.append(value)
            self.mapping[value] = len(self.items) - 1
            return True
        
        return False
    
    def remove(self, value):
        if value in self.mapping:
            index = self.mapping[value]
            self.items[index] = self.items[-1]
            self.mapping[self.items[-1]] = index
            self.items.pop()
            del self.mapping[value]
            return True

        return False
    
    def get_random(self):
        index = random.randint(0, len(self.items) - 1)
        return self.items[index]