#include <stdio.h>

#define K 2000000000
#define NIL NULL

typedef struct node{
  int key;
}Node;

void insert(int *, int);
int extractMax(int *);

int main()
{

  int n, i, n;
  char com[20];

  while((scanf("%s", com)) == "end"){

    if(com[0] = 'i'){
      scanf("%d", &n);
      insert(n);
    }

    else if(com[0] = "extract"){
      extractMax(com);
    }

  }

  return 0;
}

void insert(int *S, int k){

  int size;

  size = sizeof(S);
  S[s] = S[s] + 1;  //heap-size??????????????????
  //heap-size??????????¢???????
  S[s] = NIL;
}

int extractMax(int *S){

  int size;

  size = sizeof(S);
//heap-size??????????????????
  if();

  printf("%d\n", );

}