Set Mutations

  • + 0 comments
    N = input()
    a = set(map(int,input().split()))
    
    for i in range(int(input())):
        t = list(input().split())
        r = set(map(int,input().split()))
        eval(f"a.{t[0]}(r)")
    print(sum(a))