[Java] HashMap, TreeMap, TreeSet | Time: O(n * log n), Space: O(n)
```Java []
class TaskManager{
	private HashMap<Integer, Pair<Integer, Integer>> taskIdToPriorityAndUserIdPair;
	private TreeMap<Integer, TreeSet<Integer>> priorityToTaskIdSet;
	public TaskManager(List<List<Integer>> tasks){
		this.taskIdToPriorityAndUserIdPair = new HashMap<>();
		this.priorityToTaskIdSet = new TreeMap<>();

		for (List<Integer> task : tasks){
			this.add(task.get(0), task.get(1), task.get(2));
		}
	}

	public void add(int userId, int taskId, int priority){
		this.taskIdToPriorityAndUserIdPair.put(taskId, new Pair<>(priority, userId));

		if (!this.priorityToTaskIdSet.containsKey(priority)){
			this.priorityToTaskIdSet.put(priority, new TreeSet<>());
		}
		this.priorityToTaskIdSet.get(priority).add(taskId);
	}

	public void edit(int taskId, int newPriority){
		int oldPriority = this.taskIdToPriorityAndUserIdPair.get(taskId).getKey();

		this.taskIdToPriorityAndUserIdPair.put(
			taskId,
			new Pair<>(
				newPriority,
				this.taskIdToPriorityAndUserIdPair.get(taskId).getValue()
			)
		);

		this.priorityToTaskIdSet.get(oldPriority).remove(taskId);
		if (this.priorityToTaskIdSet.get(oldPriority).isEmpty()){
			this.priorityToTaskIdSet.remove(oldPriority);
		}

		if (!this.priorityToTaskIdSet.containsKey(newPriority)){
			this.priorityToTaskIdSet.put(newPriority, new TreeSet<>());
		}
		this.priorityToTaskIdSet.get(newPriority).add(taskId);
	}

	public void rmv(int taskId){
		int priority = this.taskIdToPriorityAndUserIdPair.get(taskId).getKey();

		this.taskIdToPriorityAndUserIdPair.remove(taskId);

		this.priorityToTaskIdSet.get(priority).remove(taskId);
		if (this.priorityToTaskIdSet.get(priority).isEmpty()){
			this.priorityToTaskIdSet.remove(priority);
		}
	}

	public int execTop(){
		if (this.priorityToTaskIdSet.isEmpty()){
			return -1;
		}

		int taskId = this.priorityToTaskIdSet.lastEntry().getValue().last();
		int userId = this.taskIdToPriorityAndUserIdPair.get(taskId).getValue();

		this.rmv(taskId);

		return userId;
	}
}
```
['Java']