#include<bits/stdc++.h>
using namespace std;

class MinHeap {
public:
    int *arr;
    int size{0};
    int capacity{1000};

    MinHeap() {
        arr = new int[capacity];
        size = 0;
    }

    ~MinHeap() {
        delete[] arr;
        arr = nullptr;
        size = 0;
    }

    int leftchild(int node) {
        int ans = 2 * node + 1;
        return ans >= size ? -1 : ans;
    }

    int rightchild(int node) {
        int ans = 2 * node + 2;
        return ans >= size ? -1 : ans;
    }

    int parent(int node) {
        return node == 0 ? -1 : (node - 1) / 2;
    }

    void heapifyUp(int child_pos) {
        int parent_pos = parent(child_pos);
        if (child_pos == 0 || parent_pos == -1 || arr[parent_pos] < arr[child_pos]) {
            return;
        }
        swap(arr[parent_pos], arr[child_pos]);
        heapifyUp(parent_pos);
    }

    void push(int node) {
        assert(!isFull());
        arr[size++] = node;
        heapifyUp(size - 1);
    }

    void heapifyDown(int parent_pos) {
        int left_child = leftchild(parent_pos);
        int right_child = rightchild(parent_pos);
        int min_child = parent_pos;

        if (left_child != -1 && arr[left_child] < arr[min_child]) {
            min_child = left_child;
        }

        if (right_child != -1 && arr[right_child] < arr[min_child]) {
            min_child = right_child;
        }

        if (min_child != parent_pos) {
            swap(arr[parent_pos], arr[min_child]);
            heapifyDown(min_child);
        }
    }

    void pop() {
        assert(!isEmpty());
        swap(arr[0], arr[--size]);
        heapifyDown(0);
    }

    int top() {
        assert(!isEmpty());
        return arr[0];
    }

    bool isEmpty() {
        return size == 0;
    }

    bool isFull() {
        return size == capacity;
    }
    
};
class MaxHeaphw{
    private:
    MinHeap minheap;
    public:
    MaxHeaphw()=default;
    MaxHeaphw(const vector<int> &v){
        for(auto &x:v){
            minheap.push(-x);
        }
    }
    bool empty(){
        return minheap.isEmpty();
    }
    int top(){
        return -minheap.top();
    }
    void pop(){
        minheap.pop();
    }
    void push(int value){
        minheap.push(-value);
    }
    bool isEmpty(){
        return minheap.isEmpty();
    }
    bool isFull(){
        return minheap.isFull();
    }
    int Size(){
        return minheap.size;
    }

};
class kthsmallest{
    private:
    int k;
    MaxHeaphw mh;
    public:
    
    kthsmallest(int k){
        this->k = k;
    }
    int next(int number){
        if(mh.Size()<k){
            mh.push(number);
        }
        else if(number<mh.top()){
            mh.pop();
            mh.push(number);
        }
        return mh.top();
    }

};

int main(){
    kthsmallest k(4);
    int number;
    while(cin >> number){
        if(number ==-1)  break;
        cout <<"answer : "<<k.next(number)<<endl;
    }
    return 0;
}