#include<stdio.h>
struct Task {
    int id, priority;
} heap[1000];
int size =0;
void swap(int i,int j) {
    struct Task t = heap[i];
    heap[i] = heap[j];
    heap[j] = t;
}
void insert(int i, int j){
    struct Task t = heap[i];
    heap[i] =heap[j];
    heap[j] = t;
    void insert(int id, int p) {
        int i =size++;
        heap[i].priority = p;
        while (i > 0 && heap[(i-1)/2].priority > heap[i].priority){
            swap(i, (i-1)/2);
            i = (i-1)/2;
        }
    }
    int main() {
        int n, id, p;
        scanf("%d %d", &is, &p);
        if (P < 0)
        printf("Invalid Input/n");
        else {
            insert(id,p);
            printf("Task Added: %d\n", id);
        }
    }
    if (size > 0)
    printf("Task with Highest priority: %d\n",heap[0].id);
    return 0;
}