import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;

public class B {

        final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE")!=null;
        BufferedReader in;
        PrintWriter out;
        StringTokenizer tok = new StringTokenizer("");

        void init() throws FileNotFoundException{
                if (ONLINE_JUDGE){
                        in = new BufferedReader(new InputStreamReader(System.in));
                        out = new PrintWriter(System.out);
                }else{
                        in = new BufferedReader(new FileReader("input.txt"));
                        out = new PrintWriter("output.txt");
                }
        }

        String readString() throws IOException{
                while(!tok.hasMoreTokens()){
                        tok = new StringTokenizer(in.readLine());
                }
                return tok.nextToken();
        }

        int readInt() throws IOException{
                return Integer.parseInt(readString());
        }

        long readLong() throws IOException{
                return Long.parseLong(readString());
        }

        double readDouble() throws IOException{
                return Double.parseDouble(readString());
        }

        int[] readArr(int n) throws IOException{
            int[] res = new int[n];
            for(int i = 0; i < n; i++){
                res[i] = readInt();
            }
            return res;
        }

        long[] readArrL(int n) throws IOException{
            long[] res = new long[n];
            for(int i = 0; i < n; i++){
                res[i] = readLong();
            }
            return res;
        }

        public static void main(String[] args){
                new B().run();
        }

        public void run(){
                try{
                        long t1 = System.currentTimeMillis();
                        init();
                        solve();
                        out.close();
                        long t2 = System.currentTimeMillis();
                        System.err.println("Time = "+(t2-t1));
                }catch (Exception e){
                        e.printStackTrace(System.err);
                        System.exit(-1);
                }
        }

        class pnt implements Comparable<pnt>{

            long r;
            int i;

            @Override
            public int compareTo(pnt o) {
                if(this.r > o.r) return -1;
                return 1;
            }

            public pnt(long r, int i) {
                super();
                this.r = r;
                this.i = i;
            }

        }

        void solve() throws IOException{
            int n = readInt();
            int t1 = readInt();
            int t2 = readInt();
            int k = readInt();
            long[] a = new long[n];
            long[] b = new long[n];
            for(int i = 0; i < n; i++){
                a[i] = readInt()*100;
                b[i] = readInt()*100;
            }
            pnt[] res = new pnt[n];
            for(int i = 0; i < n; i++){
                long cur = (a[i]*t1)*(100-k)/100 + b[i]*t2;
                cur = max(cur, (b[i]*t1)*(100-k)/100 + a[i]*t2);
                res[i] = new pnt(cur, i+1);
            }
            Arrays.sort(res);
            for(int i = 0; i < n-1; i++){
                out.print(res[i].i + " ");
                out.println(res[i].r/100+"."+(res[i].r%100/10)+""+res[i].r%10);
            }
            int i = n-1;
            out.print(res[i].i + " ");
            out.print((int)(res[i].r/100)+"."+(int)(res[i].r%100/10)+""+(int)(res[i].r%10));
        }

        void maxHepify(int[] a, int i, int length){
            int l = (i<<1) + 1;
            int r = (i<<1) + 2;
            int largest = i;
            if(l < length && a[l] > a[largest])
                largest = l;
            if(r < length && a[r] > a[largest])
                largest = r;
            if(largest != i){
                a[largest] += a[i];
                a[i] = a[largest] - a[i];
                a[largest] -= a[i];
                maxHepify(a, largest, length);
            }
        }

        void buildMaxHeap(int[] a){
            for(int i = a.length/2 - 1; i >= 0; i--){
                maxHepify(a, i, a.length);
            }
        }

        void heapSort(int[] a){
            buildMaxHeap(a);
            for(int i = a.length - 1; i > 0; i--){
                a[i] += a[0];
                a[0] = a[i] - a[0];
                a[i] -= a[0];
                maxHepify(a, 0, i);
            }
        }

        int[] zFunction(char[] s){
            int[] z = new int[s.length];
            z[0] = 0;
            for (int i=1, l=0, r=0; i<s.length; ++i) {
                if (i <= r)
                    z[i] = min (r-i+1, z[i-l]);
                while (i+z[i] < s.length && s[z[i]] == s[i+z[i]])
                    ++z[i];
                if (i+z[i]-1 > r){
                    l = i;
                    r = i+z[i]-1;
                }
            }
            return z;
        }

        int[] prefixFunction(char[] s){
            int[] pr = new int[s.length];
            for (int i = 1; i< s.length; ++i) {
                int j = pr[i-1];
                while (j > 0 && s[i] != s[j])
                    j = pr[j-1];
                if (s[i] == s[j])  ++j;
                pr[i] = j;
            }
            return pr;
        }

        int ModExp(int a, int n, int mod){
            int res = 1;
            while (n!=0)
                if ((n & 1) != 0) {
                    res = (res*a)%mod;
                    --n;
                }
                else {
                    a = (a*a)%mod;
                    n >>= 1;
                }
            return res;
        }

        public static class Utils {

            private Utils() {}

            public static void mergeSort(int[] a) {
                    mergeSort(a, 0, a.length - 1);
            }

            private static void mergeSort(int[] a, int leftIndex, int rightIndex) {
                    final int MAGIC_VALUE = 50;
                    if (leftIndex < rightIndex) {
                            if (rightIndex - leftIndex <= MAGIC_VALUE) {
                                    insertionSort(a, leftIndex, rightIndex);
                            } else {
                                    int middleIndex = (leftIndex + rightIndex) / 2;
                                    mergeSort(a, leftIndex, middleIndex);
                                    mergeSort(a, middleIndex + 1, rightIndex);
                                    merge(a, leftIndex, middleIndex, rightIndex);
                            }
                    }
            }

            private static void merge(int[] a, int leftIndex, int middleIndex, int rightIndex) {
                int length1 = middleIndex - leftIndex + 1;
                int length2 = rightIndex - middleIndex;
                int[] leftArray = new int[length1];
                int[] rightArray = new int[length2];
                System.arraycopy(a, leftIndex, leftArray, 0, length1);
                System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
                for (int k = leftIndex, i = 0, j = 0; k <= rightIndex; k++) {
                    if (i == length1) {
                            a[k] = rightArray[j++];
                    } else if (j == length2) {
                            a[k] = leftArray[i++];
                    } else {
                            a[k] = leftArray[i] <= rightArray[j] ? leftArray[i++] : rightArray[j++];
                    }
                }
            }

            private static void insertionSort(int[] a, int leftIndex, int rightIndex) {
                for (int i = leftIndex + 1; i <= rightIndex; i++) {
                    int current = a[i];
                    int j = i - 1;
                    while (j >= leftIndex && a[j] > current) {
                        a[j + 1] = a[j];
                        j--;
                        }
                    a[j + 1] = current;
                }
            }
        }

        boolean isPrime(int a){
            for(int i = 2; i <= sqrt(a); i++)
                if(a % i == 0) return false;
            return true;
        }

        static double distance(long x1, long y1, long x2, long y2){
            return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        }

        static long gcd(long a, long b){
            if(min(a,b) == 0) return max(a,b);
            return gcd(max(a, b) % min(a,b), min(a,b));
        }

        static long lcm(long a, long b){
            return a * b /gcd(a, b);
        }
}

/*class Treap<K extends Comparable<K>>{

    public K x;
    public double y;
    public Treap<K> left;
    public Treap<K> right;

    public Treap(K x, double y, Treap<K> left, Treap<K> right) {
        this.x = x;
        this.y = y;
        this.left = left;
        this.right = right;
    }

    public static <K extends Comparable<K>> Treap<K> merge(Treap<K> l, Treap<K> r){
        if(l == null) return r;
        if(r == null) return l;
        if(l.y > r.y){
            return new Treap<K>(l.x, l.y, l.left, merge(l.right, r));
        }
        else{
            return new Treap<K>(r.x, r.y, merge(l, r.left), r.right);
        }
    }

    public void split(K x, Treap<K> left, Treap<K> right){
        Treap<K> newTreap = null;
        if(this.x.compareTo(x) <= 0){
            if(this.right == null){
                right = null;
            }
            else{
                right.split(x, newTreap, right);
            }
            left = new Treap<K>(this.x, this.y, left, newTreap);
        }
        else{
            if(this.left == null){
                left = null;
            }
            else{
                left.split(x, left, newTreap);
            }
            right = new Treap<K>(x, y, newTreap, right);
        }
    }

    public Treap<K> add(K x){
        Treap<K> left = null, right = null;
        this.split(x, left, right);
        Treap<K> temp = new Treap<K>(x, random(), null, null);
        return merge(merge(left, temp), right);
    }

    @SuppressWarnings("null")
    public Treap<K> remove(K x){
        Treap<K> left = null, temp = null, right = null;
        this.split(x, left, right);
        right.split(x, temp, right);
        return merge(left, right);
    }

    public static <K extends Comparable<K>> Treap<K> build(K[] a){
        Treap<K> temp = new Treap<K>(a[0], random(), null, null);
        for(int i = 1; i < a.length; i++){
            temp = temp.add(a[i]);
        }
        return temp;
    }
}*/


import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;

public class B {

        final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE")!=null;
        BufferedReader in;
        PrintWriter out;
        StringTokenizer tok = new StringTokenizer("");

        void init() throws FileNotFoundException{
                if (ONLINE_JUDGE){
                        in = new BufferedReader(new InputStreamReader(System.in));
                        out = new PrintWriter(System.out);
                }else{
                        in = new BufferedReader(new FileReader("input.txt"));
                        out = new PrintWriter("output.txt");
                }
        }

        String readString() throws IOException{
                while(!tok.hasMoreTokens()){
                        tok = new StringTokenizer(in.readLine());
                }
                return tok.nextToken();
        }

        int readInt() throws IOException{
                return Integer.parseInt(readString());
        }

        long readLong() throws IOException{
                return Long.parseLong(readString());
        }

        double readDouble() throws IOException{
                return Double.parseDouble(readString());
        }

        int[] readArr(int n) throws IOException{
        	int[] res = new int[n];
        	for(int i = 0; i < n; i++){
        		res[i] = readInt();
        	}
        	return res;
        }

        long[] readArrL(int n) throws IOException{
        	long[] res = new long[n];
        	for(int i = 0; i < n; i++){
        		res[i] = readLong();
        	}
        	return res;
        }

        public static void main(String[] args){
                new B().run();
        }

        public void run(){
                try{
                        long t1 = System.currentTimeMillis();
                        init();
                        solve();
                        out.close();
                        long t2 = System.currentTimeMillis();
                        System.err.println("Time = "+(t2-t1));
                }catch (Exception e){
                        e.printStackTrace(System.err);
                        System.exit(-1);
                }
        }

        class pnt implements Comparable<pnt>{

        	long r;
        	int i;

			@Override
			public int compareTo(pnt o) {
				if(this.r > o.r) return -1;
				return 1;
			}

			public pnt(long r, int i) {
				super();
				this.r = r;
				this.i = i;
			}

        }

        void solve() throws IOException{
        	int n = readInt();
        	int t1 = readInt();
        	int t2 = readInt();
        	int k = readInt();
        	long[] a = new long[n];
        	long[] b = new long[n];
        	for(int i = 0; i < n; i++){
        		a[i] = readInt()*100;
        		b[i] = readInt()*100;
        	}
        	pnt[] res = new pnt[n];
        	for(int i = 0; i < n; i++){
        		long cur = (a[i]*t1)*(100-k)/100 + b[i]*t2;
        		cur = max(cur, (b[i]*t1)*(100-k)/100 + a[i]*t2);
        		res[i] = new pnt(cur, i+1);
        	}
        	Arrays.sort(res);
        	for(int i = 0; i < n-1; i++){
        		out.print(res[i].i + " ");
        		out.println(res[i].r/100+"."+(res[i].r%100/10)+""+res[i].r%10);
        	}
        	int i = n-1;
        	out.print(res[i].i + " ");
    		out.print((int)(res[i].r/100)+"."+(int)(res[i].r%100/10)+""+(int)(res[i].r%10));
        }

        void maxHepify(int[] a, int i, int length){
        	int l = (i<<1) + 1;
        	int r = (i<<1) + 2;
        	int largest = i;
        	if(l < length && a[l] > a[largest])
        		largest = l;
        	if(r < length && a[r] > a[largest])
        		largest = r;
        	if(largest != i){
        		a[largest] += a[i];
        		a[i] = a[largest] - a[i];
        		a[largest] -= a[i];
        		maxHepify(a, largest, length);
        	}
        }

        void buildMaxHeap(int[] a){
        	for(int i = a.length/2 - 1; i >= 0; i--){
        		maxHepify(a, i, a.length);
        	}
        }

        void heapSort(int[] a){
        	buildMaxHeap(a);
        	for(int i = a.length - 1; i > 0; i--){
        		a[i] += a[0];
        		a[0] = a[i] - a[0];
        		a[i] -= a[0];
        		maxHepify(a, 0, i);
        	}
        }

        int[] zFunction(char[] s){
        	int[] z = new int[s.length];
        	z[0] = 0;
        	for (int i=1, l=0, r=0; i<s.length; ++i) {
        		if (i <= r)
        			z[i] = min (r-i+1, z[i-l]);
        		while (i+z[i] < s.length && s[z[i]] == s[i+z[i]])
        			++z[i];
        		if (i+z[i]-1 > r){
        			l = i;
        			r = i+z[i]-1;
        		}
        	}
        	return z;
        }

        int[] prefixFunction(char[] s){
        	int[] pr = new int[s.length];
        	for (int i = 1; i< s.length; ++i) {
        		int j = pr[i-1];
        		while (j > 0 && s[i] != s[j])
        			j = pr[j-1];
        		if (s[i] == s[j])  ++j;
        		pr[i] = j;
        	}
        	return pr;
        }

        int ModExp(int a, int n, int mod){
        	int res = 1;
        	while (n!=0)
        		if ((n & 1) != 0) {
        			res = (res*a)%mod;
        			--n;
        		}
        		else {
        			a = (a*a)%mod;
        			n >>= 1;
        		}
        	return res;
        }

        public static class Utils {

        	private Utils() {}

        	public static void mergeSort(int[] a) {
                    mergeSort(a, 0, a.length - 1);
            }

        	private static void mergeSort(int[] a, int leftIndex, int rightIndex) {
                    final int MAGIC_VALUE = 50;
                    if (leftIndex < rightIndex) {
                            if (rightIndex - leftIndex <= MAGIC_VALUE) {
                                    insertionSort(a, leftIndex, rightIndex);
                            } else {
                                    int middleIndex = (leftIndex + rightIndex) / 2;
                                    mergeSort(a, leftIndex, middleIndex);
                                    mergeSort(a, middleIndex + 1, rightIndex);
                                    merge(a, leftIndex, middleIndex, rightIndex);
                            }
                    }
            }

            private static void merge(int[] a, int leftIndex, int middleIndex, int rightIndex) {
            	int length1 = middleIndex - leftIndex + 1;
            	int length2 = rightIndex - middleIndex;
                int[] leftArray = new int[length1];
                int[] rightArray = new int[length2];
                System.arraycopy(a, leftIndex, leftArray, 0, length1);
                System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
                for (int k = leftIndex, i = 0, j = 0; k <= rightIndex; k++) {
                    if (i == length1) {
                            a[k] = rightArray[j++];
                    } else if (j == length2) {
                            a[k] = leftArray[i++];
                    } else {
                            a[k] = leftArray[i] <= rightArray[j] ? leftArray[i++] : rightArray[j++];
                    }
                }
            }

            private static void insertionSort(int[] a, int leftIndex, int rightIndex) {
                for (int i = leftIndex + 1; i <= rightIndex; i++) {
            		int current = a[i];
                    int j = i - 1;
                	while (j >= leftIndex && a[j] > current) {
                        a[j + 1] = a[j];
                        j--;
                        }
                    a[j + 1] = current;
                }
            }
        }

        boolean isPrime(int a){
        	for(int i = 2; i <= sqrt(a); i++)
        		if(a % i == 0) return false;
        	return true;
        }

        static double distance(long x1, long y1, long x2, long y2){
        	return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        }

        static long gcd(long a, long b){
        	if(min(a,b) == 0) return max(a,b);
        	return gcd(max(a, b) % min(a,b), min(a,b));
        }

        static long lcm(long a, long b){
        	return a * b /gcd(a, b);
        }
}

/*class Treap<K extends Comparable<K>>{

	public K x;
	public double y;
	public Treap<K> left;
	public Treap<K> right;

	public Treap(K x, double y, Treap<K> left, Treap<K> right) {
		this.x = x;
		this.y = y;
		this.left = left;
		this.right = right;
	}

	public static <K extends Comparable<K>> Treap<K> merge(Treap<K> l, Treap<K> r){
		if(l == null) return r;
		if(r == null) return l;
		if(l.y > r.y){
			return new Treap<K>(l.x, l.y, l.left, merge(l.right, r));
		}
		else{
			return new Treap<K>(r.x, r.y, merge(l, r.left), r.right);
		}
	}

	public void split(K x, Treap<K> left, Treap<K> right){
		Treap<K> newTreap = null;
		if(this.x.compareTo(x) <= 0){
			if(this.right == null){
				right = null;
			}
			else{
				right.split(x, newTreap, right);
			}
			left = new Treap<K>(this.x, this.y, left, newTreap);
		}
		else{
			if(this.left == null){
				left = null;
			}
			else{
				left.split(x, left, newTreap);
			}
			right = new Treap<K>(x, y, newTreap, right);
		}
	}

	public Treap<K> add(K x){
		Treap<K> left = null, right = null;
		this.split(x, left, right);
		Treap<K> temp = new Treap<K>(x, random(), null, null);
		return merge(merge(left, temp), right);
	}

	@SuppressWarnings("null")
	public Treap<K> remove(K x){
		Treap<K> left = null, temp = null, right = null;
		this.split(x, left, right);
		right.split(x, temp, right);
		return merge(left, right);
	}

	public static <K extends Comparable<K>> Treap<K> build(K[] a){
		Treap<K> temp = new Treap<K>(a[0], random(), null, null);
		for(int i = 1; i < a.length; i++){
			temp = temp.add(a[i]);
		}
		return temp;
	}
}*/


import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;

public class B {

        final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE")!=null;
        BufferedReader in;
        PrintWriter out;
        StringTokenizer tok = new StringTokenizer("");

        void init() throws FileNotFoundException{
                if (ONLINE_JUDGE){
                        in = new BufferedReader(new InputStreamReader(System.in));
                        out = new PrintWriter(System.out);
                }else{
                        in = new BufferedReader(new FileReader("input.txt"));
                        out = new PrintWriter("output.txt");
                }
        }

        String readString() throws IOException{
                while(!tok.hasMoreTokens()){
                        tok = new StringTokenizer(in.readLine());
                }
                return tok.nextToken();
        }

        int readInt() throws IOException{
                return Integer.parseInt(readString());
        }

        long readLong() throws IOException{
                return Long.parseLong(readString());
        }

        double readDouble() throws IOException{
                return Double.parseDouble(readString());
        }

        int[] readArr(int n) throws IOException{
        	int[] res = new int[n];
        	for(int i = 0; i < n; i++){
        		res[i] = readInt();
        	}
        	return res;
        }

        long[] readArrL(int n) throws IOException{
        	long[] res = new long[n];
        	for(int i = 0; i < n; i++){
        		res[i] = readLong();
        	}
        	return res;
        }

        public static void main(String[] args){
                new B().run();
        }

        public void run(){
                try{
                        long t1 = System.currentTimeMillis();
                        init();
                        solve();
                        out.close();
                        long t2 = System.currentTimeMillis();
                        System.err.println("Time = "+(t2-t1));
                }catch (Exception e){
                        e.printStackTrace(System.err);
                        System.exit(-1);
                }
        }

        class pnt implements Comparable<pnt>{

        	long r;
        	int i;

			@Override
			public int compareTo(pnt o) {
				if(this.r > o.r) return -1;
				return 1;
			}

			public pnt(long r, int i) {
				super();
				this.r = r;
				this.i = i;
			}

        }

        void solve() throws IOException{
        	int n = readInt();
        	int t1 = readInt();
        	int t2 = readInt();
        	int k = readInt();
        	long[] a = new long[n];
        	long[] b = new long[n];
        	for(int i = 0; i < n; i++){
        		a[i] = readInt()*100;
        		b[i] = readInt()*100;
        	}
        	pnt[] res = new pnt[n];
        	for(int i = 0; i < n; i++){
        		long cur = (a[i]*t1)*(100-k)/100 + b[i]*t2;
        		cur = max(cur, (b[i]*t1)*(100-k)/100 + a[i]*t2);
        		res[i] = new pnt(cur, i+1);
        	}
        	Arrays.sort(res);
        	for(int i = 0; i < n; i++){
        		out.print(res[i].i + " ");
        		out.println(res[i].r/100+"."+(res[i].r%100/10)+""+res[i].r%10);
        	}
        }

        void maxHepify(int[] a, int i, int length){
        	int l = (i<<1) + 1;
        	int r = (i<<1) + 2;
        	int largest = i;
        	if(l < length && a[l] > a[largest])
        		largest = l;
        	if(r < length && a[r] > a[largest])
        		largest = r;
        	if(largest != i){
        		a[largest] += a[i];
        		a[i] = a[largest] - a[i];
        		a[largest] -= a[i];
        		maxHepify(a, largest, length);
        	}
        }

        void buildMaxHeap(int[] a){
        	for(int i = a.length/2 - 1; i >= 0; i--){
        		maxHepify(a, i, a.length);
        	}
        }

        void heapSort(int[] a){
        	buildMaxHeap(a);
        	for(int i = a.length - 1; i > 0; i--){
        		a[i] += a[0];
        		a[0] = a[i] - a[0];
        		a[i] -= a[0];
        		maxHepify(a, 0, i);
        	}
        }

        int[] zFunction(char[] s){
        	int[] z = new int[s.length];
        	z[0] = 0;
        	for (int i=1, l=0, r=0; i<s.length; ++i) {
        		if (i <= r)
        			z[i] = min (r-i+1, z[i-l]);
        		while (i+z[i] < s.length && s[z[i]] == s[i+z[i]])
        			++z[i];
        		if (i+z[i]-1 > r){
        			l = i;
        			r = i+z[i]-1;
        		}
        	}
        	return z;
        }

        int[] prefixFunction(char[] s){
        	int[] pr = new int[s.length];
        	for (int i = 1; i< s.length; ++i) {
        		int j = pr[i-1];
        		while (j > 0 && s[i] != s[j])
        			j = pr[j-1];
        		if (s[i] == s[j])  ++j;
        		pr[i] = j;
        	}
        	return pr;
        }

        int ModExp(int a, int n, int mod){
        	int res = 1;
        	while (n!=0)
        		if ((n & 1) != 0) {
        			res = (res*a)%mod;
        			--n;
        		}
        		else {
        			a = (a*a)%mod;
        			n >>= 1;
        		}
        	return res;
        }

        public static class Utils {

        	private Utils() {}

        	public static void mergeSort(int[] a) {
                    mergeSort(a, 0, a.length - 1);
            }

        	private static void mergeSort(int[] a, int leftIndex, int rightIndex) {
                    final int MAGIC_VALUE = 50;
                    if (leftIndex < rightIndex) {
                            if (rightIndex - leftIndex <= MAGIC_VALUE) {
                                    insertionSort(a, leftIndex, rightIndex);
                            } else {
                                    int middleIndex = (leftIndex + rightIndex) / 2;
                                    mergeSort(a, leftIndex, middleIndex);
                                    mergeSort(a, middleIndex + 1, rightIndex);
                                    merge(a, leftIndex, middleIndex, rightIndex);
                            }
                    }
            }

            private static void merge(int[] a, int leftIndex, int middleIndex, int rightIndex) {
            	int length1 = middleIndex - leftIndex + 1;
            	int length2 = rightIndex - middleIndex;
                int[] leftArray = new int[length1];
                int[] rightArray = new int[length2];
                System.arraycopy(a, leftIndex, leftArray, 0, length1);
                System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
                for (int k = leftIndex, i = 0, j = 0; k <= rightIndex; k++) {
                    if (i == length1) {
                            a[k] = rightArray[j++];
                    } else if (j == length2) {
                            a[k] = leftArray[i++];
                    } else {
                            a[k] = leftArray[i] <= rightArray[j] ? leftArray[i++] : rightArray[j++];
                    }
                }
            }

            private static void insertionSort(int[] a, int leftIndex, int rightIndex) {
                for (int i = leftIndex + 1; i <= rightIndex; i++) {
            		int current = a[i];
                    int j = i - 1;
                	while (j >= leftIndex && a[j] > current) {
                        a[j + 1] = a[j];
                        j--;
                        }
                    a[j + 1] = current;
                }
            }
        }

        boolean isPrime(int a){
        	for(int i = 2; i <= sqrt(a); i++)
        		if(a % i == 0) return false;
        	return true;
        }

        static double distance(long x1, long y1, long x2, long y2){
        	return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        }

        static long gcd(long a, long b){
        	if(min(a,b) == 0) return max(a,b);
        	return gcd(max(a, b) % min(a,b), min(a,b));
        }

        static long lcm(long a, long b){
        	return a * b /gcd(a, b);
        }
}

/*class Treap<K extends Comparable<K>>{

	public K x;
	public double y;
	public Treap<K> left;
	public Treap<K> right;

	public Treap(K x, double y, Treap<K> left, Treap<K> right) {
		this.x = x;
		this.y = y;
		this.left = left;
		this.right = right;
	}

	public static <K extends Comparable<K>> Treap<K> merge(Treap<K> l, Treap<K> r){
		if(l == null) return r;
		if(r == null) return l;
		if(l.y > r.y){
			return new Treap<K>(l.x, l.y, l.left, merge(l.right, r));
		}
		else{
			return new Treap<K>(r.x, r.y, merge(l, r.left), r.right);
		}
	}

	public void split(K x, Treap<K> left, Treap<K> right){
		Treap<K> newTreap = null;
		if(this.x.compareTo(x) <= 0){
			if(this.right == null){
				right = null;
			}
			else{
				right.split(x, newTreap, right);
			}
			left = new Treap<K>(this.x, this.y, left, newTreap);
		}
		else{
			if(this.left == null){
				left = null;
			}
			else{
				left.split(x, left, newTreap);
			}
			right = new Treap<K>(x, y, newTreap, right);
		}
	}

	public Treap<K> add(K x){
		Treap<K> left = null, right = null;
		this.split(x, left, right);
		Treap<K> temp = new Treap<K>(x, random(), null, null);
		return merge(merge(left, temp), right);
	}

	@SuppressWarnings("null")
	public Treap<K> remove(K x){
		Treap<K> left = null, temp = null, right = null;
		this.split(x, left, right);
		right.split(x, temp, right);
		return merge(left, right);
	}

	public static <K extends Comparable<K>> Treap<K> build(K[] a){
		Treap<K> temp = new Treap<K>(a[0], random(), null, null);
		for(int i = 1; i < a.length; i++){
			temp = temp.add(a[i]);
		}
		return temp;
	}
}*/


import java.io.*;
import java.util.*;

public class B {

	static class member{
		int v,u;
		double height;
		int number;
		member(int i,int a,int b){
			v=a;
			u=b;
			number=i+1;
		}
		void getheight(int t1,int t2,int k){
			double s1,s2;
			s1=((double)(v*t1)*(double)(100-k)/100)+u*t2;
			s2=((double)(u*t1)*(double)(100-k)/100)+v*t2;
			if(s1>s2)
				height=s1;
			else
				height=s2;
			return;
		}
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n= sc.nextInt();
		int t1= sc.nextInt();
		int t2= sc.nextInt();
		int k= sc.nextInt();
		int a,b;
		member[] comp=new member[n];
		for (int i=0;i<n;i++){
			a=sc.nextInt();
			b=sc.nextInt();
			comp[i]=new member(i,a,b);
			comp[i].getheight(t1, t2, k);
		}
		member temp=new member(0,0,0);
		boolean t=true;
		while (t){
			int i=0;
			t=false;
			while(i<n-1){

				if (comp[i].height<comp[i+1].height){
					temp=comp[i+1];
					comp[i+1]=comp[i];
					comp[i]=temp;
					t=true;
				}
				if (comp[i].height==comp[i+1].height){
					if (comp[i].number>comp[i+1].number){
						temp=comp[i+1];
						comp[i+1]=comp[i];
						comp[i]=temp;
						t=true;
					}
				}
				i++;
			}
		}
		for (int i=0;i<n;i++)
			pw.println(comp[i].number+" "+String.format("%.2f",comp[i].height));
		pw.close();
		return;
	}
}


import static java.util.Arrays.deepToString;

import java.io.*;
import java.util.*;

public class A {

	static class Pair{
		int num;
		double val;
		Pair(int num, double val){
			this.num = num;
			this.val = val;
		}
	}
	static void solve() throws Exception {
		int n = nextInt();
		Pair[] results = new Pair[n];
		int t1 = nextInt();
		int t2 = nextInt();
		double k = nextInt()/100.0;
		for(int i = 0; i < n; i++){
			int v1 = nextInt();
			int v2 = nextInt();
//			System.out.println();
//			System.out.print(i + " ");
//			System.out.print(t1 * v1 * k + t2 * v2);
//			System.out.print( " " + (t1 * v2 * k + t2 * v1) + "\n");
			double maxHeights = Math.max(t1 * v1  - (t1 * v1 * k )+ t2 * v2, t1 * v2 - (t1 * v2 * k) + t2 * v1);
			results[i] = new Pair(i + 1, maxHeights);
		}
		Arrays.sort(results, new Comparator<Pair>() {

			@Override
			public int compare(Pair p1, Pair p2) {
				if(p1.val > p2.val){
					return -1;
				}else if(p1.val < p2.val){
					return 1;
				}else{
					return 0;
				}
			}
		});
		for(int i = 0; i < n; i++){
			System.out.printf("%d %.2f\n",results[i].num , results[i].val);
		}
	}

	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;

	static void debug(Object... a) {
		System.err.println(deepToString(a));
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	static String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return null;
			}
			st = new StringTokenizer(line);
		}
		return st.nextToken();
	}

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			solve();
			br.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}


import java.io.*;
import java.text.DecimalFormat;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in= new Scanner(System.in);
        int n,t1,t2; double k;
        DecimalFormat df= new DecimalFormat(".00");
        n=in.nextInt(); t1=in.nextInt();
        t2=in.nextInt(); k=in.nextInt();
        k= k/100;
        ArrayList<p> players= new ArrayList<p>();
        for (int i = 0; i < n; i++) {
            int s1= in.nextInt(); int s2= in.nextInt();
            double sum1= (s1*t1)-(s1*t1)*k+(s2*t2);
            double sum2= (s2*t1)-(s2*t1)*k+(s1*t2);
            if(sum1>sum2)
                players.add(new p(i+1,new Double(df.format(sum1)) ));
            else
                players.add(new p(i+1,new Double(df.format(sum2)) ));
        }
        Collections.sort(players);
        for(p pl : players){
            System.out.print(pl.ind+" "+pl.time);
            if(pl.time.toString().split("[.]")[1].length()==1)
                System.out.print("0");
            System.out.print("\n");
        }

    }

}

class p implements Comparable<p>{
    int ind;
    Double time;
    p(int i,double d){
        ind=i; time=d;
    }

    public int compareTo(p o) {
        if(this.time==o.time){
            if(this.ind>o.ind)
                return 1;
            else return -1;
        }
        if(this.time<o.time)
            return 1;
        return -1;
    }
}


import java.io.*;
import java.util.*;
import java.lang.Math.*;
public class mush implements Comparable
{
     int a;
     double b;
     mush(int a,double b)
     {
         this.a=a;
         this.b=b;
        }

     public static void main(String args[])throws Exception
     {
         Scanner in=new Scanner(System.in);
         //BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
         //BufferedReader br = new BufferedReader(new FileReader("mush.in"));
         //PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("mush.out")));
         PrintWriter pw = new PrintWriter(System.out);
         //StringTokenizer st;
         int n=in.nextInt();
         double t1=(double)in.nextInt();
         double t2=(double)in.nextInt();
         double k=(double)in.nextInt();
         double u=0.0,v=0.0,res=0.0;
         int i,j,l;
         mush obj[]=new mush[n];
         for(i=0;i<n;i++)
         {
             u=(double)in.nextInt();
             v=(double)in.nextInt();
             double left=1.0-k/100.00;
             if(t1*left-t2 >0)
             {
                 if(u>v)
                 res=u*t1*(left)+v*t2;
                 else
                 res=v*t1*(left)+u*t2;
                }

                else
                {
                 if(v>u)
                 res=u*t1*(left)+v*t2;
                 else
                 res=v*t1*(left)+u*t2;
                }
                obj[i]=new mush(i+1,res);

            }
            Arrays.sort(obj);
            for(i=0;i<n;i++)
            {
                System.out.format("%d %.2f%n",obj[i].a,obj[i].b);
            }
     }
     public int compareTo(Object obj)
     {
         mush temp=(mush)obj;
         if(this.a<temp.a)
         return 1;
         else
         return -1;
        }
}


import java.io.*;
import java.util.*;
import java.lang.Math.*;
public class mush implements Comparable
{
     int a;
     double b;
     mush(int a,double b)
     {
         this.a=a;
         this.b=b;
        }

     public static void main(String args[])throws Exception
     {
         Scanner in=new Scanner(System.in);
         //BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
         //BufferedReader br = new BufferedReader(new FileReader("mush.in"));
         //PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("mush.out")));
         PrintWriter pw = new PrintWriter(System.out);
         //StringTokenizer st;
         int n=in.nextInt();
         double t1=(double)in.nextInt();
         double t2=(double)in.nextInt();
         double k=(double)in.nextInt();
         double u=0.0,v=0.0,res=0.0;
         int i,j,l;
         mush obj[]=new mush[n];
         for(i=0;i<n;i++)
         {
             u=(double)in.nextInt();
             v=(double)in.nextInt();
             double left=1.0-k/100.00;
             if(t1*left-t2 >0)
             {
                 if(u>v)
                 res=u*t1*(left)+v*t2;
                 else
                 res=v*t1*(left)+u*t2;
                }

                else
                {
                 if(v>u)
                 res=u*t1*(left)+v*t2;
                 else
                 res=v*t1*(left)+u*t2;
                }
                obj[i]=new mush(i+1,res);

            }
            Arrays.sort(obj);
            for(i=0;i<n;i++)
            {
                System.out.format("%d %.2f%n",obj[i].a,obj[i].b);
            }
     }
     public int compareTo(Object obj)
     {
         mush temp=(mush)obj;
         if(this.b<temp.b)
         return 1;
         else
         return -1;
        }
}


import java.io.*;
import java.util.*;

public class B {
	public static void main(String[] args) {
		try {
			new B().solve();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	int n, t1, t2, k;
	void solve() throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String[] sp = in.readLine().split(" ");
		n = Integer.parseInt(sp[0]);
		t1 = Integer.parseInt(sp[1]);
		t2 = Integer.parseInt(sp[2]);
		k = Integer.parseInt(sp[3]);
		Dwarf[] dw = new Dwarf[n];
		for (int i = 0; i < n; i++) {
			sp = in.readLine().split(" ");
			int a = Integer.parseInt(sp[0]);
			int b = Integer.parseInt(sp[1]);
			dw[i] = new Dwarf(i + 1, a, b);
		}
		Arrays.sort(dw);
		for (int i = 0; i < n; i++) {
			System.out.printf("%d %.2f\n", dw[i].number, dw[i].h);
		}
	}
	class Dwarf implements Comparable<Dwarf> {
		int number;
		double h;

		Dwarf(int num, int a, int b) {
			number = num;
			h = Math.max(a * t1 * (100.0 - k) / 100.0 + b * t2, b * t1 * (100.0 - k) / 100.0 + a * t2);
		}
		@Override
		public int compareTo(Dwarf d) {
			if (h == d.h) {
				return number - d.number;
			} else {
				return h - d.h > 0 ? -1 : 1;
			}
		}
	}
}


import java.io.*;
import java.util.*;

public class B {
	public static void main(String[] args) {
		try {
			new B().solve();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	int n, t1, t2, k;
	void solve() throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String[] sp = in.readLine().split(" ");
		n = Integer.parseInt(sp[0]);
		t1 = Integer.parseInt(sp[1]);
		t2 = Integer.parseInt(sp[2]);
		k = Integer.parseInt(sp[3]);
		Dwarf[] dw = new Dwarf[n];
		for (int i = 0; i < n; i++) {
			sp = in.readLine().split(" ");
			int a = Integer.parseInt(sp[0]);
			int b = Integer.parseInt(sp[1]);
			dw[i] = new Dwarf(i + 1, a, b);
		}
		Arrays.sort(dw);
		for (int i = n - 1; i >= 0; i--) {
			System.out.printf("%d %.2f\n", dw[i].number, dw[i].h);
		}
	}
	class Dwarf implements Comparable<Dwarf> {
		int number;
		double h;

		Dwarf(int num, int a, int b) {
			number = num;
			h = Math.max(a * t1 * (100.0 - k) / 100.0 + b * t2, b * t1 * (100.0 - k) / 100.0 + a * t2);
		}
		@Override
		public int compareTo(Dwarf d) {
			if (h == d.h) {
				return number - d.number;
			} else {
				return h - d.h > 0 ? 1 : -1;
			}
		}
	}
}


import java.io.*;
import java.text.DecimalFormat;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in= new Scanner(System.in);
        int n,t1,t2; double k;
        DecimalFormat df= new DecimalFormat(".00");
        n=in.nextInt(); t1=in.nextInt();
        t2=in.nextInt(); k=in.nextInt();
        k= k/100;
        ArrayList<p> players= new ArrayList<p>();
        for (int i = 0; i < n; i++) {
            int s1= in.nextInt(); int s2= in.nextInt();
            double sum1= (s1*t1)-(s1*t1)*k+(s2*t2);
            double sum2= (s2*t1)-(s2*t1)*k+(s1*t2);
            if(sum1>sum2)
                players.add(new p(i+1,new Double(df.format(sum1)) ));
            else
                players.add(new p(i+1,new Double(df.format(sum2)) ));
        }
        Collections.sort(players);
        for(p pl : players){
            System.out.print(pl.ind+" "+pl.time);
            if(pl.time.toString().split("[.]")[1].length()==1)
                System.out.print("0");
            System.out.print("\n");
        }

    }

}

class p implements Comparable<p>{
    int ind;
    Double time;
    p(int i,double d){
        ind=i; time=d;
    }

    public int compareTo(p o) {
        if(this.time==o.time){
            return -new Integer(this.ind).compareTo(o.ind);
        }
        return -time.compareTo(o.time);
    }
}


import java.io.*;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.InputMismatchException;

public class R118_D2_B {
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader(System.in);
        // BufferedReader in = new BufferedReader(new
        // InputStreamReader(System.in));
        int n = in.readInt();
        int t1 = in.readInt();
        int t2 = in.readInt();
        double per = 1.0 - (in.readInt() / 100.0);
        pp[] inp = new pp[n];
        for (int i = 0; i < inp.length; i++) {
            double sp1 = in.readInt();
            double sp2 = in.readInt();
            double max = Math.max(sp1 * t1 * per + sp2 * t2, sp2 * t1 * per
                    + sp1 * t2);
            inp[i] = new pp(i + 1, (int) sp1, (int) sp2, max);
        }
        Arrays.sort(inp);
        DecimalFormat f = new DecimalFormat("0.00");
        for (int i = 0; i < inp.length; i++) {
            System.out.println(inp[i].index + " " + f.format(inp[i].res));
        }
    }

    static class pp implements Comparable<pp> {
        int index;
        int sp1;
        int sp2;
        double res;

        public pp(int a, int b, int c, double d) {
            index = a;
            sp1 = b;
            sp2 = c;
            res = d;
        }

        @Override
        public int compareTo(pp o) {
            if (o.res < res)
                return -1;
            if (res < o.res)
                return 1;
            return index - o.index;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1000];
        private int curChar, numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private String readLine0() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public String readLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public String readLine(boolean ignoreEmptyLines) {
            if (ignoreEmptyLines)
                return readLine();
            else
                return readLine0();
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public double readDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, readInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
    }

}


import java.io.*;
import java.util.*;

public class B
{
	BufferedReader in;
	Scanner s;
	PrintStream out;
	StringTokenizer tok;
	public B() throws NumberFormatException, IOException
	{
		//s = new Scanner(System.in);
		in = new BufferedReader(new InputStreamReader(System.in));
		out = System.out;
		run();
	}
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		new B();
	}
	public String nextToken() throws IOException
	{
		if(tok == null || !tok.hasMoreTokens()) tok = new StringTokenizer(in.readLine());
		return tok.nextToken();
	}
	public int nextInt() throws NumberFormatException, IOException
	{
		return Integer.parseInt(nextToken());
	}
	public long nextLong() throws NumberFormatException, IOException
	{
		return Long.parseLong(nextToken());
	}
	public double nextDouble()throws NumberFormatException, IOException
	{
		return Double.parseDouble(nextToken());
	}

	public void run() throws NumberFormatException, IOException
	{
		int part = nextInt();
		int t1 = nextInt();
		int t2 = nextInt();
		double p = nextDouble();
		ArrayList<Element> list = new ArrayList<Element>();

		for(int i = 0; i < part; i++)
		{
			list.add(new Element(i+1,nextDouble(), nextDouble(), p, t1, t2));
		}
		Collections.sort(list);
		for(int j = 0; j < part; j++)
		{
			out.print(list.get(j).id);
			out.printf(" %.2f\n",list.get(j).total);
		}
	}
}
class Element implements Comparable<Element>
{
	public double total;
	public int id;

	public Element(int d,double a, double b, double percent, double t1, double t2)
	{
		id = d;
		double a1 = + a*t1 - (a*t1*percent/100d) + b*t2;
		double b1 = b*t1 - (b*t1*percent/100d) + a*t2;
		total = Math.max(a1, b1);
	}

	@Override
	public int compareTo(Element other) {
		if(total > other.total)return -1;
		else if(other.total > total)return 1;
		return (id > other.id)?1:-1;
	}

}


import java.io.*;
import java.util.*;

public class B
{
    BufferedReader in;
    Scanner s;
    PrintStream out;
    StringTokenizer tok;
    public B() throws NumberFormatException, IOException
    {
        //s = new Scanner(System.in);
        in = new BufferedReader(new InputStreamReader(System.in));
        out = System.out;
        run();
    }
    public static void main(String[] args) throws NumberFormatException, IOException
    {
        new B();
    }
    public String nextToken() throws IOException
    {
        if(tok == null || !tok.hasMoreTokens()) tok = new StringTokenizer(in.readLine());
        return tok.nextToken();
    }
    public int nextInt() throws NumberFormatException, IOException
    {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws NumberFormatException, IOException
    {
        return Long.parseLong(nextToken());
    }
    public double nextDouble()throws NumberFormatException, IOException
    {
        return Double.parseDouble(nextToken());
    }

    public void run() throws NumberFormatException, IOException
    {
        int part = nextInt();
        int t1 = nextInt();
        int t2 = nextInt();
        double p = nextDouble();
        ArrayList<Element> list = new ArrayList<Element>();

        for(int i = 0; i < part; i++)
        {
            list.add(new Element(i+1,nextDouble(), nextDouble(), p, t1, t2));
        }
        Collections.sort(list);
        for(int j = 0; j < part; j++)
        {
            out.print(list.get(j).id);
            out.printf(" %.2f\n",list.get(j).total);
        }
    }
}
class Element implements Comparable<Element>
{
    public double total;
    public int id;

    public Element(int d,double a, double b, double percent, double t1, double t2)
    {
        id = d;
        double a1 = + a*t1 - (a*percent/100d) + b*t2;
        double b1 = b*t1 - (b*percent/100d) + a*t2;
        total = Math.max(a1, b1);
    }

    @Override
    public int compareTo(Element other) {
        if(total > other.total)return -1;
        else if(other.total > total)return 1;
        return (id > other.id)?1:-1;
    }

}


import java.io.*;
import java.util.*;

public class B
{
	BufferedReader in;
	Scanner s;
	PrintStream out;
	StringTokenizer tok;
	public B() throws NumberFormatException, IOException
	{
		//s = new Scanner(System.in);
		in = new BufferedReader(new InputStreamReader(System.in));
		out = System.out;
		run();
	}
	public static void main(String[] args) throws NumberFormatException, IOException
	{
		new B();
	}
	public String nextToken() throws IOException
	{
		if(tok == null || !tok.hasMoreTokens()) tok = new StringTokenizer(in.readLine());
		return tok.nextToken();
	}
	public int nextInt() throws NumberFormatException, IOException
	{
		return Integer.parseInt(nextToken());
	}
	public long nextLong() throws NumberFormatException, IOException
	{
		return Long.parseLong(nextToken());
	}
	public double nextDouble()throws NumberFormatException, IOException
	{
		return Double.parseDouble(nextToken());
	}

	public void run() throws NumberFormatException, IOException
	{
		int part = nextInt();
		int t1 = nextInt();
		int t2 = nextInt();
		double p = nextDouble();
		ArrayList<Element> list = new ArrayList<Element>();

		for(int i = 0; i < part; i++)
		{
			list.add(new Element(i+1,nextDouble(), nextDouble(), p, t1, t2));
		}
		Collections.sort(list);
		for(int j = 0; j < part; j++)
		{
			out.print(list.get(j).id);
			out.printf(" %.2f\n",list.get(j).total);
		}
	}
}
class Element implements Comparable<Element>
{
	public double total;
	public int id;

	public Element(int d,double a, double b, double percent, double t1, double t2)
	{
		id = d;
		double a1 = + a*t1 - (a*percent/100d) + b;
		double b1 = b*t1*(b*percent/100d) + a;
		total = Math.max(a1, b1);
	}

	@Override
	public int compareTo(Element other) {
		if(total > other.total)return -1;
		else if(other.total > total)return 1;
		return (id > other.id)?1:-1;
	}

}


import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;

public class Main {
   public static void main(String[] args) throws IOException
   {
	   (new Main()).solve();
   }
   public void Main() {
   }

   void solve()  throws IOException {
	  //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	  //Scanner in = new Scanner(System.in);
	   MyReader in = new MyReader();
	  PrintWriter out = new PrintWriter(System.out);
     // Scanner in = new Scanner(new FileReader("input.txt"));
	//  PrintWriter out = new PrintWriter("output.txt");
	  int n = in.nextInt();
	  int t1 = in.nextInt();
	  int t2 = in.nextInt();
	  int k = in.nextInt();
	  G[] gn = new G[n];

	  for (int i = 0; i < n; i++) {
		  int a = in.nextInt();
		  int b = in.nextInt();
		  int res1 = a * t1 * (100 - k) + b * t2 * 100;
		  int res2 = b * t1 * (100 - k) + a * t2 * 100;
		  if (res1 < res2) {
			  res1 = res2;
		  }
		  gn[i] = new G(res1, i + 1);
	  }

	  Arrays.sort(gn, new G(0, 0));

	  for (G t : gn) {
		  out.print(t.num + " " + t.h/100 + ".");
		  if (t.h % 100 < 10) {
			  out.print("0");
		  }
		  out.println(t.h  % 100);
	  }

	out.close();
   }

};

class G implements Comparator<G> {
	public int h;
	public int num;

	public G(int h, int num) {
		super();
		this.h = h;
		this.num = num;
	}

	@Override
	public int compare(G arg0, G arg1) {
		if (arg0.h > arg1.h) {
			return -1;
		}
		if (arg0.h < arg1.h) {
			return 1;
		}
		return 0;
	}
}

class MyReader {
	private BufferedReader in;
	String[] parsed;
	int index = 0;

	public MyReader() {
		in = new BufferedReader(new InputStreamReader(System.in));
	}

	public int nextInt() throws NumberFormatException, IOException {
		if (parsed == null || parsed.length == index) {
			read();
		}
		return Integer.parseInt(parsed[index++]);
	}

	public long nextLong() throws NumberFormatException, IOException {
		if (parsed == null || parsed.length == index) {
			read();
		}
		return Long.parseLong(parsed[index++]);
	}

	public String nextString() throws IOException {
		if (parsed == null || parsed.length == index) {
			read();
		}
		return parsed[index++];
	}

	private void read() throws IOException {
		parsed = in.readLine().split(" ");
		index = 0;
	}

	public String readLine() throws IOException {
		return in.readLine();
	}
};


import java.util.Arrays;
import java.util.Scanner;

public class C_118B {
	static class Height implements Comparable<Height>{
		int ind;
		double h;
		public int compareTo(Height arg0) {
			if(this.h < arg0.h) return 1;
			return 0;
		}
		public Height(double x, int y) {
			h = x;
			ind = y;
		}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int t1 = sc.nextInt();
		int t2 = sc.nextInt();
		int k = sc.nextInt();
		int a [] = new int [n];
		int b [] = new int [n];
		double max=Integer.MIN_VALUE;
		int ind = 0;
		Height h[] = new Height[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			double h1 = (double) a[i]*t1*(100-k)/100 + b[i]*t2;
			double h2 = (double) b[i]*t1*(100-k)/100 + a[i]*t2;

			h[i] = new Height(Math.max(h1, h2),i);

		}
		Arrays.sort(h);
		for (int i = 0; i < n; i++) {
			System.out.print((h[i].ind+1)+" ");
			System.out.printf("%.2f",h[i].h);
			System.out.println();
		}

	}
}


#include <bits/stdc++.h>
using namespace std;
vector<pair<double,int> > v;

int main(){
double n,t1,t2,a,b,k,drop,temp,p,o,t;cin>>n>>t1>>t2>>k;
  p=(100-k)/100;
  for(int i=0;i<n;i++){
    cin>>a>>b;
    o = (a*t1) * p + (b*t2);
    t = (b*t1) * p + (a*t2);
    drop= max(o,t);
    v.push_back({-1 * drop,i+1});
  }

  vector<pair<double,int> >::iterator iter=v.begin();
  sort(v.begin(),v.end());

  for(int i=0;i<n;i++)cout<<( (iter+i)->second)<<" "<<setprecision(2)<<fixed<<-1 * ((iter+i)->first)<<endl;

}


#include <bits/stdc++.h>
using namespace std;
vector<pair<double,int> > v;
vector<int> c;

int main(){
double n,t1,t2,a,b,k,drop,temp,p,o,t;cin>>n>>t1>>t2>>k;
  p=(100-k)/100;
  for(int i=0;i<n;i++){
    cin>>a>>b;
    o = (a*t1) * p + (b*t2);
    t = (b*t1) * p + (a*t2);
    drop= max(o,t);
    v.push_back({drop,i+1});
  }

  vector<pair<double,int> >::iterator iter=v.begin();
  sort(v.rbegin(),v.rend());
  for(int i =0;i<n-1;i++){
    for(int j=0;j<n;j++){
      if(((iter+i)->second) > ((iter+j)->second) && ((iter+i)->first)==((iter+j)->first) ) {
        swap(((iter+i)->second),((iter+j)->second));
      }
    }
  }
  for(int i=0;i<n;i++)cout<<((iter+i)->second)<<" "<<setprecision(2)<<fixed<<((iter+i)->first)<<endl;

}


#include <bits/stdc++.h>
using namespace std;
char a[1000][1000];
vector<pair<double,int> > v;
vector<int> c;

int main(){
double n,t1,t2,a,b,k,drop,p;cin>>n>>t1>>t2>>k;
  p=(100-k)/100;
  for(int i=0;i<n;i++){
    cin>>a>>b;
    if(a<=b)drop = (a*t1*p)+(b*t2);
    else drop = (b*t1*p)+(a*t2);
    v.push_back({drop,i+1});
  }
  sort(v.rbegin(),v.rend());
  vector<pair<double,int> >::iterator iter=v.begin();
  for(int i=0;i<n;i++)cout<<((iter+i)->second)<<" "<<setprecision(2)<<fixed<<((iter+i)->first)<<endl;

}


#include <bits/stdc++.h>
using namespace std;
char a[1000][1000];
vector<pair<double,int> > v;
vector<int> c;

 bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
}
int main(){
double n,t1,t2,a,b,k,drop,temp,p;cin>>n>>t1>>t2>>k;
  p=(100-k)/100;
  for(int i=0;i<n;i++){
    cin>>a>>b;
  if((a*t1*p) >=(b*t1*p))drop = (a*t1*p)+(b*t2);    else drop = (b*t1*p)+(a*t2);
    v.push_back({drop,i+1});
  }

  //sort(v.rbegin(),v.rend(),sortbysec);
  vector<pair<double,int> >::iterator iter=v.begin();
  sort(v.rbegin(),v.rend());
  for(int i =0;i<n-1;i++){
    for(int j=0;j<n;j++){
      if(((iter+i)->second) > ((iter+j)->second) && ((iter+i)->first)==((iter+j)->first) ) {
        swap(((iter+i)->second),((iter+j)->second));
      }
    }
  }
  for(int i=0;i<n;i++)cout<<((iter+i)->second)<<" "<<setprecision(2)<<fixed<<((iter+i)->first)<<endl;

}


#include <bits/stdc++.h>
using namespace std;
char a[1000][1000];
vector<pair<double,int> > v;
vector<int> c;

 bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
}
int main(){
double n,t1,t2,a,b,k,drop,temp,p;cin>>n>>t1>>t2>>k;
  p=(100-k)/100;
  for(int i=0;i<n;i++){
    cin>>a>>b;
    if(a<=b)drop = (a*t1*p)+(b*t2);
    else drop = (b*t1*p)+(a*t2);
    v.push_back({drop,i+1});
  }

  //sort(v.rbegin(),v.rend(),sortbysec);
  vector<pair<double,int> >::iterator iter=v.begin();
  sort(v.rbegin(),v.rend());
  for(int i =0;i<n-1;i++){
    for(int j=0;j<n;j++){
      if(((iter+i)->second) > ((iter+j)->second) && ((iter+i)->first)==((iter+j)->first) ) {
        swap(((iter+i)->second),((iter+j)->second));
      }
    }
  }
  for(int i=0;i<n;i++)cout<<((iter+i)->second)<<" "<<setprecision(2)<<fixed<<((iter+i)->first)<<endl;

}


var input = readline().trim().split(' ').map((x)=>parseInt(x));
var n=input[0],t1=input[1],t2=input[2],k=input[3];

var participant = function(a,b,i) {
	this.a = a;
	this.b =b;
	this.i = i+1;
	this.maxi = (parseInt(Math.max(this.a*t1*(100-k)/100+this.b*t2,this.b*t1*(100-k)/100+this.a*t2)*100)*1.0)/100;
}
participant.prototype.print=function(){
    var out =this.i+' '+this.maxi;
    var m = (this.maxi+'').split('.')[1];
    if(m==undefined)
    out+='.00'
    else if(m.length==0)
        out+='00';
    else if(m.length==1)
     out+='0';
    print(out)
}
var p=[];
var ab;
for (var i = 0; i < n; i++) {
	ab=readline().trim().split(' ').map((x)=>parseFloat(x));
	p.push(new participant(ab[0],ab[1],i));
}
var sort = function(p1,p2) {
	return p1.maxi==p2.maxi?(p1.i-p2.i):(p2.maxi-p1.maxi);
}
p.sort(sort);

for (var i in p) {
	p[i].print();
}


var input = readline().trim().split(' ').map((x)=>parseInt(x));
var n=input[0],t1=input[1],t2=input[2],k=input[3];

var participant = function(a,b,i) {
	this.a = a;
	this.b =b;
	this.i = i+1;
	this.maxi = Math.max(this.a*t1*(100-k)/100+this.b*t2,this.b*t1*(100-k)/100+this.a*t2).toFixed(2);
}
participant.prototype.print=function(){
    print(this.i+' '+this.maxi)
}
var p=[];
var ab;
for (var i = 0; i < n; i++) {
	ab=readline().trim().split(' ').map((x)=>parseFloat(x));
	p.push(new participant(ab[0],ab[1],i));
}
var sort = function(p1,p2) {
	return p1.maxi==p2.maxi?(p1.i-p2.i):(p2.maxi-p1.maxi);
}
p.sort(sort);

for (var i in p) {
	p[i].print();
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,t,k,i,j,l,sum=0;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    /*for(i=0;i<n;i++)
    {
        cout<<a[i]<<" ";
    }*/
    cout<<a[1]<<endl;;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,t,k,i,j,l,sum=0;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    cout<<a[n-2]<<endl;;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,t,k,i,j,l,sum=0;
    cin>>n;
    int a[n];
    sum=(n-1)/2;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    /*for(i=0;i<n;i++)
    {
        cout<<a[i]<<" ";
    }*/
    cout<<a[sum]<<endl;;
}


#include <bits/stdc++.h>
#define ll long long
#define ss second
#define forever while(true)

using namespace std;

int main(){
	int N;
	std::cin >> N;
	int a[N + 1];

	for (int i = 1; i <= N; i++) {
		std::cin >> a[i];
	}

	std::sort(a + 1, a + N + 1);

	std::cout << a[2];

	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ss second
#define forever while(true)

using namespace std;

int main(){
	int N;
	std::cin >> N;
	int a[N + 1];

	for (int i = 1; i <= N; i++) {
		std::cin >> a[i];
	}

	std::sort(a + 1, a + N + 1);

	std::cout << a[N - 1];

	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ss second
#define forever while(true)

using namespace std;

int main(){
	int N;
	std::cin >> N;
	int a[N + 1];

	for (int i = 1; i <= N; i++) {
		std::cin >> a[i];
	}

	std::sort(a + 1, a + N + 1);

	if (N == 1)
	return std::cout << a[1], 0;

	std::cout << a[2];

	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ss second
#define forever while(true)

using namespace std;

int main(){
	int N;
	std::cin >> N;
	int a[N + 1];

	for (int i = 1; i <= N; i++) {
		std::cin >> a[i];
	}

	std::sort(a + 1, a + N + 1);

	if (N == 1)
		return std::cout << a[1], 0;

	if (N == 2)
		return std::cout << a[1], 0;

	std::cout << a[2];

	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ss second
#define forever while(true)

using namespace std;

int main(){
	int N;
	std::cin >> N;
	int a[N + 1];

	for (int i = 1; i <= N; i++) {
		std::cin >> a[i];
	}

	std::sort(a + 1, a + N + 1);

	if (N == 1)
		return std::cout << a[1], 0;

	if (N == 2)
		return std::cout << a[1], 0;

	std::cout << a[N / 2 + N % 2];

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define pb push_back
#define stll stack<ll>
#define qll queue<ll>
#define pqll priority_queue<ll>
#define mpii map<int,int>
#define mpll map<ll,ll>
#define mpss map<string,string>
#define mpsi map<string,int>
#define mpis map<int,string>
#define mpsll map<string,ll>
#define mplls map<ll,string>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define asrt(a) sort(a, a+n)
#define grtasrt(a) sort(a, a+n,greater<int>())
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define mem(a,x) memset(a,x,sizeof(a))
#define inf 0x3f3f3f3f
#define mx 10000
const int mxn=2e5+9;
const int mod=1e9+7;
int main ()
{
    fast;
    ll n;
    cin>>n;
    ll a[n];
    for(ll i = 0; i<n; i++)
    {
        cin>>a[i];
    }
    if(n % 2 == 1)
    cout<<a[0];
    else
        cout<<a[1];
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define pb push_back
#define stll stack<ll>
#define qll queue<ll>
#define pqll priority_queue<ll>
#define mpii map<int,int>
#define mpll map<ll,ll>
#define mpss map<string,string>
#define mpsi map<string,int>
#define mpis map<int,string>
#define mpsll map<string,ll>
#define mplls map<ll,string>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define asrt(a) sort(a, a+n)
#define grtasrt(a) sort(a, a+n,greater<int>())
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define mem(a,x) memset(a,x,sizeof(a))
#define inf 0x3f3f3f3f
#define mx 10000
const int mxn=2e5+9;
const int mod=1e9+7;
int main ()
{
    fast;
    ll n;
    cin>>n;
    ll a[n];
    for(ll i = 0; i<n; i++)
    {
        cin>>a[i];
    }
    cout<<a[0];
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define pb push_back
#define stll stack<ll>
#define qll queue<ll>
#define pqll priority_queue<ll>
#define mpii map<int,int>
#define mpll map<ll,ll>
#define mpss map<string,string>
#define mpsi map<string,int>
#define mpis map<int,string>
#define mpsll map<string,ll>
#define mplls map<ll,string>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define asrt(a) sort(a, a+n)
#define grtasrt(a) sort(a, a+n,greater<int>())
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define mem(a,x) memset(a,x,sizeof(a))
#define inf 0x3f3f3f3f
#define mx 10000
const int mxn=2e5+9;
const int mod=1e9+7;
int main ()
{
    fast;
    ll n;
    cin>>n;
    ll a[n];
    for(ll i = 0; i<n; i++)
    {
        cin>>a[i];
    }
   sort(a, a+n);
   cout<<a[1]
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define pb push_back
#define stll stack<ll>
#define qll queue<ll>
#define pqll priority_queue<ll>
#define mpii map<int,int>
#define mpll map<ll,ll>
#define mpss map<string,string>
#define mpsi map<string,int>
#define mpis map<int,string>
#define mpsll map<string,ll>
#define mplls map<ll,string>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define asrt(a) sort(a, a+n)
#define grtasrt(a) sort(a, a+n,greater<int>())
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define mem(a,x) memset(a,x,sizeof(a))
#define inf 0x3f3f3f3f
#define mx 10000
const int mxn=2e5+9;
const int mod=1e9+7;
int main ()
{
    fast;
    ll n;
    cin>>n;
    ll a[n];
    for(ll i = 0; i<n; i++)
    {
        cin>>a[i];
    }
   sort(a, a+n);
   ll y = (n/2) -1;
   if(n % 2 == 0)
   {
       cout<<a[y];
   }
   else
   {
       cout<<a[y+1];
   }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define pb push_back
#define stll stack<ll>
#define qll queue<ll>
#define pqll priority_queue<ll>
#define mpii map<int,int>
#define mpll map<ll,ll>
#define mpss map<string,string>
#define mpsi map<string,int>
#define mpis map<int,string>
#define mpsll map<string,ll>
#define mplls map<ll,string>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define asrt(a) sort(a, a+n)
#define grtasrt(a) sort(a, a+n,greater<int>())
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define mem(a,x) memset(a,x,sizeof(a))
#define inf 0x3f3f3f3f
#define mx 10000
const int mxn=2e5+9;
const int mod=1e9+7;
int main ()
{
    fast;
    ll n;
    cin>>n;
    ll a[n];
    for(ll i = 0; i<n; i++)
    {
        cin>>a[i];
    }
   sort(a, a+n);
   cout<<a[1];
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    do {
      cin >> n;
    }
    while (n < 2 || n > 100);
    int a[n+1];
    for (int i = 1; i <= n; i++){
        cin >> a[i];
    }
    for (int i = 2; i <= n; i++){
        int s = a[i];
        int j = i-1;
        while (j > 0 &&  a[j] > s){
            a[j+1] = a[j];
            j = j-1;
        }
        a[j+1] = s;
    }
    int last = a[(n+1) / 2];
    cout << last << endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    do {
      cin >> n;
    }
    while (n < 2 || n > 100);
    int a[n+1];
    for (int i = 1; i <= n; i++){
        cin >> a[i];
    }
    int s;
    int j;
    for (int i = 2; i <= n; i++){
        s = a[i];
        j = i-1;
        while (j > 0 &&  a[j] > s){
            a[j+1] = a[j];
            j = j-1;
        }
        a[j+1] = s;
    }
    int last = a[(n+1) / 2];
    cout << last << endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    int s;
    int j;
    for (int i = 1; i < n; i++){
        s = a[i];
        j = i-1;
        while (j >= 0 &&  a[j] > s){
            a[j+1] = a[j];
            j = j-1;
        }
        a[j+1] = s;
    }
    int last = a[(n+1)/2-1];
    cout << last << endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    int s;
    int j;
    for (int i = 1; i < n; i++){
        s = a[i];
        j = i-1;
        while (j >= 0 &&  a[j] > s){
            a[j+1] = a[j];
            j = j-1;
        }
        a[j+1] = s;
    }
    //for (int i=0; i<n; i++)
        //cout << a[i] << " ";
    int last = a[(n+1) / 2];
    cout << last << endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    int s;
    int j;
    for (int i = 1; i < n; i++){
        s = a[i];
        j = i-1;
        while (j > 0 &&  a[j] > s){
            a[j+1] = a[j];
            j = j-1;
        }
        a[j+1] = s;
    }
    int last = a[(n+1) / 2];
    cout << last << endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    int s;
    int j;
    for (int i = 1; i < n; i++){
        s = a[i];
        j = i-1;
        while (j > 0 &&  a[j] > s){
            a[j+1] = a[j];
            j = j-1;
        }
        a[j+1] = s;
    }
    int last = a[(n+1) / 2-1];
    cout << last << endl;
    return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;

int main(){

    int n;

    cin>>n;

    int arr[n];

    for(int i=0;i<n;i++){
        cin>>arr[i];
    }

    sort(arr,arr+n);

    int l,m;

    l=0;
    m=n-1;
    int z=0;
    while(z<n-1){
        l++;
        z++;
        if(z<n-1)
            m--;
            z++;
    }

    cout<<arr[l]<<endl;
}


#include<iostream>
#include<algorithm>

using namespace std;

int main(){

    int n;

    cin>>n;

    int arr[n];

    for(int i=0;i<n;i++){
        cin>>arr[i];
    }

    sort(arr,arr+n);

    int l,m;

    l=0;
    m=n-1;

    while(l!=m){
        l++;
        if(l!=m)
            m--;
    }

    cout<<arr[l]<<endl;
}


#include<iostream>
#include<algorithm>

using namespace std;

int main(){

    int n;

    cin>>n;

    int arr[n];

    for(int i=0;i<n;i++){
        cin>>arr[i];
    }

    sort(arr,arr+n);

    int l,m;

    l=0;
    m=n-1;

    while(l!=m){
        l++;
        m--;
    }

    cout<<arr[l]<<endl;
}


#include<iostream>
#include<algorithm>

using namespace std;

int main(){

    long long int n;

    cin>>n;

    long long int arr[n];

    for(int i=0;i<n;i++){
        cin>>arr[i];
    }

    sort(arr,arr+n);

    long long int l,m;

    l=0;
    m=n-1;
    long long int z=0;
    while(z<n-1){
        l++;
        z++;
        if(z<n-1)
            m--;
            z++;
    }

    cout<<arr[l]<<endl;
}


#include<iostream>
#include<algorithm>

using namespace std;

int main(){

    long long int n;

    cin>>n;

    long long int arr[n];

    for(int i=0;i<n;i++){
        cin>>arr[i];
    }

    sort(arr,arr+n);

    long long int l,m;

    l=0;
    m=n-1;
    long long int z=0;
    while(z<n-1){
        m--;
        z++;
        if(z<n-1)
            l++;
            z++;
    }

    cout<<arr[l]<<endl;
}


#include <iostream>
#include <vector>

using namespace std;

int partition(vector<int> &arr, int l, int r) {
	int left = l, right = r, mid;
	while (right > left) {
		mid = left + (right - left) / 2;
		while (arr[left] < arr[mid]) left++;
		while (arr[right - 1] > arr[mid]) right--;
		if (left != right) swap(arr[left++], arr[right-- - 1]);
		else return right;
	}
	return right;
}

int find_mid(vector<int> &arr) {
	int left = 0, right = arr.size(), mid, stat = ceiling((double)arr.size() / 2) - 1;
	while (right > left) {
		mid = partition(arr, left, right);
		if (mid == stat) {
			return arr[mid];
		}
		else {
			if (mid > stat) {
				right = mid;
			}
			else {
				left = mid + 1;
				stat -= mid + 1;
			}
		}
	}
	return arr[right];
}

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<int> arr(n);
	for (size_t i = 0; i < n; i++) cin >> arr[i];

	cout << find_mid(arr) << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int partition(vector<int> &arr, int l, int r) {
	int left = l, right = r, mid;
	while (right > left) {
		mid = left + (right - left) / 2;
		while (arr[left] < arr[mid]) left++;
		while (arr[right - 1] > arr[mid]) right--;
		if (left != right) swap(arr[left++], arr[right-- - 1]);
		else return right;
	}
	return right;
}

int find_mid(vector<int> &arr) {
	int left = 0, right = arr.size(), mid, stat = ceil((double)arr.size() / 2) - 1;
	while (right > left) {
		mid = partition(arr, left, right);
		if (mid == stat) {
			return arr[mid];
		}
		else {
			if (mid > stat) {
				right = mid;
			}
			else {
				left = mid + 1;
				stat -= mid + 1;
			}
		}
	}
	return arr[right];
}

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<int> arr(n);
	for (size_t i = 0; i < n; i++) cin >> arr[i];

	cout << find_mid(arr) << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<int> arr(n);
	for (size_t i = 0; i < n; i++) cin >> arr[i];

	//sort(arr.begin(), arr.end());
	nth_element(arr.begin(), arr.begin() + (n - 1) / 2, arr.end());
	cout << arr[(n - 1) >> 1] << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int partition(vector<int> &arr, int l, int r) {
	int left = l, right = r, mid;
	while (right > left) {
		mid = left + (right - left) / 2;
		while (arr[left] < arr[mid]) left++;
		while (arr[right - 1] > arr[mid]) right--;
		if (left != right) swap(arr[left++], arr[right-- - 1]);
		else return right;
	}
	return right;
}

int find_mid(vector<int> &arr) {
	int left = 0, right = arr.size(), mid, stat = ceil((double)arr.size() / 2) - 1;
	while (right > left) {
		mid = partition(arr, left, right);
		if (mid == stat) {
			return arr[mid];
		}
		else {
			if (mid > stat) {
				right = mid;
			}
			else {
				left = mid + 1;
				stat -= mid + 1;
			}
		}
	}
	return arr[right];
}

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<int> arr(n);
	for (size_t i = 0; i < n; i++) cin >> arr[i];

	cout << find_mid(arr) << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<int> arr(n);
	for (size_t i = 0; i < n; i++) cin >> arr[i];

	sort(arr.begin(), arr.end());
	//nth_element(arr.begin(), arr.begin() + arr.size() / 2, arr.end());
	cout << arr[arr.size() / 2] << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int partition(vector<int> &arr, int l, int r) {
	int left = l, right = r, mid = l + (r - l) / 2;
	while (right > left) {
		while (arr[left] < arr[mid]) left++;
		while (arr[right] > arr[mid]) right--;
		if (left >= right) break;
		if (left == mid) {
			swap(arr[left++], arr[right]);
			mid = right;
		}
		else if (right == mid) {
			swap(arr[left], arr[right--]);
			mid = left;
		}
		else {
			swap(arr[left++], arr[right--]);
		}
	}
	return right;
}

int find_mid(vector<int> &arr) {
	int left = 0, right = arr.size(), stat = arr.size() / 2;
	while (true) {
		int mid = partition(arr, left, right - 1);
		if (mid == stat + left) {
			return arr[left + stat];
		}
		else if (mid > stat + left) {
				right = mid;
    	}
		else {
			stat -= (mid - left) + 1;
			left = mid + 1;
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<int> arr(n);
	for (size_t i = 0; i < n; i++) cin >> arr[i];

	cout << find_mid(arr) << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int partition(vector<int> &arr, int l, int r) {
	int left = l, right = r, mid = l + (r - l) / 2;
	while (right > left) {
		while (arr[left] < arr[mid]) left++;
		while (arr[right] > arr[mid]) right--;
		if (left >= right) break;
		if (left == mid) {
			swap(arr[left++], arr[right]);
			mid = right;
		}
		else if (right == mid) {
			swap(arr[left], arr[right--]);
			mid = left;
		}
		else {
			swap(arr[left++], arr[right--]);
		}
	}
	return right;
}

int find_mid(vector<int> &arr) {
	int left = 0, right = arr.size(), stat = (arr.size() - 1) / 2;
	while (true) {
		int mid = partition(arr, left, right - 1);
		if (mid == stat + left) {
			return arr[left + stat];
		}
		else if (mid > stat + left) {
				right = mid;
    	}
		else {
			stat -= (mid - left) + 1;
			left = mid + 1;
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<int> arr(n);
	for (size_t i = 0; i < n; i++) cin >> arr[i];

	cout << find_mid(arr) << endl;
	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;

	vector<int> arr(n);
	for (size_t i = 0; i < n; i++) cin >> arr[i];

	nth_element(arr.begin(), arr.begin() + arr.size() / 2, arr.end());
	cout << arr[arr.size() / 2] << endl;
	//system("pause");
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

void Merge(long long int ar[], long long int l, long long int mid, long long int h)
{
    long long int i, j, k;
    long long int ar2[h+1];

    i = l;
    j = mid+1;
    k = l;

    while(i <= mid && j <= h)
    {
        if(ar[i] < ar[j])
        {
            ar2[k] = ar[i];
            k++;
            i++;
        }
        else
        {
            ar2[k] = ar[j];
            k++;
            j++;
        }
    }

    for( ; i <= mid; i++)
    {
        ar2[k] = ar[i];
        k++;
    }

    for( ; j <= h; j++)
    {
        ar2[k] = ar[j];
        k++;
    }

    for(i=l; i<=h; i++)
    {
        ar[i] = ar2[i];
    }

}

void IterMergeSort(long long int ar[], long long int n)
{
    long long int p, i, l, mid, h;

    ///Passes
    for(p=2; p<=n; p=p*2)
    {
        for(i=0; i < n-(p-1); i = i+p)
        {
            l = i;
            h = i+p-1;
            mid = (l+h)/2;
            Merge(ar, l, mid, h);
        }
    }

    if(p/2 < n)
    {
        Merge(ar, 0, (p/2)-1, n-1);
    }
}

int main()
{
    long long int n, i, j, k;
    cin>>n;
    long long int ar[n];

    for(i=0; i<n; i++)
    {
        cin>>ar[i];
    }

    IterMergeSort(ar, n);

    /*for(i=0; i<n; i++)
    {
        cout<<ar[i]<<" ";
    }*/

    long long int ind;

    if(n%2 == 0)
    {
        ind = (n/2)-1;
    }
    else
    {
        ind = floor(n/2);
    }
    cout<<ar[ind];

}


#include<bits/stdc++.h>

using namespace std;

void Merge(long long int ar[], long long int l, long long int mid, long long int h)
{
    long long int i, j, k;
    long long int temp[h+1];

    i = l;
    j = mid+1;
    k = l;

    while(i <= mid && j <= h)
    {
        if(ar[i] < ar[j])
        {
            temp[k++] = ar[i++];
        }
        else
        {
            temp[k++] = ar[j++];
        }
    }

    for( ; i<=mid; i++)
    {
        temp[k++] = ar[i];
    }

    for( ; j<=h; j++)
    {
        temp[k++] = ar[j];
    }

    for(i=l; i<=h; i++)
    {
        ar[i] = temp[i];
    }
}

void Rec_Mergesort(long long int ar[], long long int l, long long int h)
{
    if(l < h)
    {
        long long int mid = (l+h)/2;
        Rec_Mergesort(ar, l, mid);
        Rec_Mergesort(ar, mid+1, h);
        Merge(ar, l, mid, h);
    }
}

int main()
{
    long long int n, i, j, k;
    cin>>n;
    long long int ar[n];

    for(i=0; i<n; i++)
    {
        cin>>ar[i];
    }

    Rec_Mergesort(ar, 0, n-1);

    /*for(i=0; i<n; i++)
    {
        cout<<ar[i]<<" ";
    }*/

    long long int ind;

    if(n%2 == 0)
    {
        ind = (n/2)-1;
    }
    else
    {
        ind = floor(n/2);
    }
    cout<<ar[ind];

}


#include<bits/stdc++.h>

using namespace std;

void Merge(int ar[], int l, int mid, int h)
{
    int i, j, k;
    int ar2[h+1];

    i = l;
    j = mid+1;
    k = l;

    while(i <= mid && j <= h)
    {
        if(ar[i] < ar[j])
        {
            ar2[k] = ar[i];
            k++;
            i++;
        }
        else
        {
            ar2[k] = ar[j];
            k++;
            j++;
        }
    }

    for( ; i <= mid; i++)
    {
        ar2[k] = ar[i];
        k++;
    }

    for( ; j <= h; j++)
    {
        ar2[k] = ar[j];
        k++;
    }

    for(i=l; i<=h; i++)
    {
        ar[i] = ar2[i];
    }

}

void IterMergeSort(int ar[], int n)
{
    int p, i, l, mid, h;

    ///Passes
    for(p=2; p<=n; p=p*2)
    {
        for(i=0; i < n-(p-1); i = i+p)
        {
            l = i;
            h = i+p-1;
            mid = (l+h)/2;
            Merge(ar, l, mid, h);
        }
    }

    if(p/2 < n)
    {
        Merge(ar, 0, (p/2)-1, n-1);
    }
}

int main()
{
    int n, i, j, k;
    cin>>n;
    int ar[n];

    for(i=0; i<n; i++)
    {
        cin>>ar[i];
    }

    IterMergeSort(ar, n);

    int ind;
    if(n%2 == 0)
    {
        ind = (n/2)+1;
    }
    else
    {
        ind = n/2;
    }
    cout<<ar[ind];

}


#include<bits/stdc++.h>

using namespace std;

void Merge(int ar[], int l, int mid, int h)
{
    int i, j, k;
    int ar2[h+1];

    i = l;
    j = mid+1;
    k = l;

    while(i <= mid && j <= h)
    {
        if(ar[i] < ar[j])
        {
            ar2[k] = ar[i];
            k++;
            i++;
        }
        else
        {
            ar2[k] = ar[j];
            k++;
            j++;
        }
    }

    for( ; i <= mid; i++)
    {
        ar2[k] = ar[i];
        k++;
    }

    for( ; j <= h; j++)
    {
        ar2[k] = ar[j];
        k++;
    }

    for(i=l; i<=h; i++)
    {
        ar[i] = ar2[i];
    }

}

void IterMergeSort(int ar[], int n)
{
    int p, i, l, mid, h;

    ///Passes
    for(p=2; p<=n; p=p*2)
    {
        for(i=0; i < n-(p-1); i = i+p)
        {
            l = i;
            h = i+p-1;
            mid = (l+h)/2;
            Merge(ar, l, mid, h);
        }
    }

    if(p/2 < n)
    {
        Merge(ar, 0, (p/2)-1, n-1);
    }
}

int main()
{
    int n, i, j, k;
    cin>>n;
    int ar[n];

    for(i=0; i<n; i++)
    {
        cin>>ar[i];
    }

    IterMergeSort(ar, n);

    /*for(i=0; i<n; i++)
    {
        cout<<ar[i]<<" ";
    }*/

    int ind;
    if(n%2 == 0)
    {
        ind = (n/2)-1;
    }
    else
    {
        ind = n/2;
    }
    cout<<ar[ind];

}


#include<bits/stdc++.h>

using namespace std;

void Merge(long long int ar[], long long int l, long long int mid, long long int h)
{
    long long int i, j, k;
    long long int ar2[h+1];

    i = l;
    j = mid+1;
    k = l;

    while(i <= mid && j <= h)
    {
        if(ar[i] < ar[j])
        {
            ar2[k] = ar[i];
            k++;
            i++;
        }
        else
        {
            ar2[k] = ar[j];
            k++;
            j++;
        }
    }

    for( ; i <= mid; i++)
    {
        ar2[k] = ar[i];
        k++;
    }

    for( ; j <= h; j++)
    {
        ar2[k] = ar[j];
        k++;
    }

    for(i=l; i<=h; i++)
    {
        ar[i] = ar2[i];
    }

}

void IterMergeSort(long long int ar[], long long int n)
{
    long long int p, i, l, mid, h;

    ///Passes
    for(p=2; p<=n; p=p*2)
    {
        for(i=0; i < n-(p-1); i = i+p)
        {
            l = i;
            h = i+p-1;
            mid = (l+h)/2;
            Merge(ar, l, mid, h);
        }
    }

    if(p/2 < n)
    {
        Merge(ar, 0, (p/2)-1, n-1);
    }
}

int main()
{
    long long int n, i, j, k;
    cin>>n;
    long long int ar[n];

    for(i=0; i<n; i++)
    {
        cin>>ar[i];
    }

    IterMergeSort(ar, n);

    /*for(i=0; i<n; i++)
    {
        cout<<ar[i]<<" ";
    }*/

    long long int ind;

    if(n%2 == 0)
    {
        ind = (n/2)-1;
    }
    else
    {
        ind = n/2;
    }
    cout<<ar[ind];

}


#include<bits/stdc++.h>

using namespace std;

void Merge(int ar[], int l, int mid, int h)
{
    int i, j, k;
    int ar2[h+1];

    i = l;
    j = mid+1;
    k = l;

    while(i <= mid && j <= h)
    {
        if(ar[i] < ar[j])
        {
            ar2[k] = ar[i];
            k++;
            i++;
        }
        else
        {
            ar2[k] = ar[j];
            k++;
            j++;
        }
    }

    for( ; i <= mid; i++)
    {
        ar2[k] = ar[i];
        k++;
    }

    for( ; j <= h; j++)
    {
        ar2[k] = ar[j];
        k++;
    }

    for(i=l; i<=h; i++)
    {
        ar[i] = ar2[i];
    }

}

void IterMergeSort(int ar[], int n)
{
    int p, i, l, mid, h;

    ///Passes
    for(p=2; p<=n; p=p*2)
    {
        for(i=0; i < n-(p-1); i = i+p)
        {
            l = i;
            h = i+p-1;
            mid = (l+h)/2;
            Merge(ar, l, mid, h);
        }
    }

    if(p/2 < n)
    {
        Merge(ar, 0, (p/2)-1, n-1);
    }
}

int main()
{
    int n, i, j, k;
    cin>>n;
    int ar[n];

    for(i=0; i<n; i++)
    {
        cin>>ar[i];
    }

    IterMergeSort(ar, n);

    for(i=0; i<n; i++)
    {
        cout<<ar[i]<<" ";
    }

    int ind;
    if(n%2 == 0)
    {
        ind = (n/2)-1;
    }
    else
    {
        ind = n/2;
    }
    cout<<ar[ind];

}


#include<bits/stdc++.h>

using namespace std;

void Merge(long long int ar[], long long int l, long long int mid, long long int h)
{
    long long int i, j, k;
    long long int ar2[h+1];

    i = l;
    j = mid+1;
    k = l;

    while(i <= mid && j <= h)
    {
        if(ar[i] < ar[j])
        {
            ar2[k] = ar[i];
            k++;
            i++;
        }
        else
        {
            ar2[k] = ar[j];
            k++;
            j++;
        }
    }

    for( ; i <= mid; i++)
    {
        ar2[k] = ar[i];
        k++;
    }

    for( ; j <= h; j++)
    {
        ar2[k] = ar[j];
        k++;
    }

    for(i=l; i<=h; i++)
    {
        ar[i] = ar2[i];
    }

}

void IterMergeSort(long long int ar[], long long int n)
{
    long long int p, i, l, mid, h;

    ///Passes
    for(p=2; p<=n; p=p*2)
    {
        for(i=0; i < n-(p-1); i = i+p)
        {
            l = i;
            h = i+p-1;
            mid = (l+h)/2;
            Merge(ar, l, mid, h);
        }
    }

    if(p/2 < n)
    {
        Merge(ar, 0, (p/2)-1, n-1);
    }
}

int main()
{
    long long int n, i, j, k;
    cin>>n;
    long long int ar[n];

    for(i=0; i<n; i++)
    {
        cin>>ar[i];
    }

    IterMergeSort(ar, n);

    /*for(i=0; i<n; i++)
    {
        cout<<ar[i]<<" ";
    }*/

    long long int ind;
    if(n%2 == 0)
    {
        ind = (n/2)-1;
    }
    else
    {
        ind = n/2;
    }
    cout<<ar[ind];

}


#include<bitd/stdc++.h>
using namespace std;
int main()
{
   int n,a[1000000],i;
   cin>>n;
   for(i=1;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    if(n%2!=0)
        cout<<a[n/2+1]<<"\n";
    else:
        cout<<a[n/2]<<"\n";

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,a[1000000],i;
   cin>>n;
   for(i=0;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    for(i=0;i<n;i++)
        cout<<a[i];
    if(n%2!=0)
        cout<<a[n/2]<<"\n";
    else
        cout<<a[n/2+1]<<"\n";

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,a[1000000],i;
   cin>>n;
   for(i=1;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    if(n%2!=0)
        cout<<a[n/2+1]<<"\n";
    else:
        cout<<a[n/2]<<"\n";

}


 #include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,a[1000000],i;
   cin>>n;
   for(i=1;i<=n;i++)
    cin>>a[i];
    sort(a,a+n);
    if(n%2!=0)
        cout<<a[n/2+1]<<"\n";
    else
        cout<<a[n/2]<<"\n";

}


 #include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,a[1000000],i;
   cin>>n;
   for(i=0;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    if(n%2!=0)
        cout<<a[n/2]<<"\n";
    else
        cout<<a[n/2-1]<<"\n";

}


 #include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,a[1000000],i;
   cin>>n;
   for(i=0;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    if(n%2!=0)
        cout<<a[n/2]<<"\n";
    else
        cout<<a[n/2+1]<<"\n";

}


 #include<bits/stdc++.h>
using namespace std;
int main()
{
   int n,a[1000000],i;
   cin>>n;
   for(i=1;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    if(n%2!=0)
        cout<<a[n/2+1]<<"\n";
    else
        cout<<a[n/2]<<"\n";

}


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

int main()
{
    int a;
    cin>>a;
    int arr[a];
    for(int i=0;i<a;i++)
    {
        cin>>arr[i];
    }
    sort(arr,arr+a);
    if(a%2!=0)
        cout<<arr[a/2]<<endl;
    else
        cout<<arr[(a/2)-1]<<endl;

    return 0;
}


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

int main()
{
    int a;
    cin>>a;
    int arr[a];
    for(int i=0;i<a;i++)
    {
        cin>>arr[i];
    }
    sort(arr,arr+a);

    cout<<arr[(a/2)+1]<<endl;

    return 0;
}


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

int main()
{
    int a;
    cin>>a;
    int arr[a];
    for(int i=0;i<a;i++)
    {
        cin>>arr[i];
    }
    sort(arr,arr+a);
    cout<<arr[a/2]<<endl;

    return 0;
}


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

int main()
{
    int a;
    cin>>a;
    int arr[a];
    for(int i=0;i<a;i++)
    {
        cin>>arr[i];
    }

    cout<<arr[(a/2)+1]<<endl;

    return 0;
}


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

int main()
{
    int a;
    cin>>a;
    int arr[a];
    for(int i=0;i<a;i++)
    {
        cin>>arr[i];
    }

    cout<<arr[a/2]<<endl;

    return 0;
}


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

int main() {
int a;
cin >>a;
int freq[a];
for(int i=0;i<a;i++){
cin>>freq[i];
}
sort(freq,freq+a);
cout<<freq[(a-1)/2];

/*int a ,m;
cin >>a;
for (int i =0;i<a;i++){
cin>>m;
freq[m]++;
}
sort(freq,freq+101,greater<int>());
cout<<freq[0];*/
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
    {
int a;
cin >>a;
int b[a];
for(int i =0;i<a;i++){
cin >>b[i];
}
cout<<b[0];
     return 0;
    }


#include<bits/stdc++.h>
using namespace std;
int main()
{ int a[1001]={0};
  int b;
    cin>>b;
    for(int i=1;i<b;i++){
        cin>>a[i];
    }
    sort(a+1,a+b+1);
    cout<<a[(b+1)/2]<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ int a[1010]={0};
  int b;
    cin>>b;
    for(int i=1;i<=b;i++){
        cin>>a[i];
    }
    sort(a+1,a+b+1);
    cout<<a[(b+1)/2]<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ int a[1001]={0};
  int b;
    cin>>b;
    for(int i=1;i<=b;i++){
        cin>>a[i];
    }
    sort(a,a+b);
    cout<<a[(b+1)/2]<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ int a[1001]={0};
  int b;
    cin>>b;
    for(int i=0;i<b;i++){
        cin>>a[i];
    }
    sort(a,a+b);
    cout<<a[(b+1)/2]<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ int a[1001]={0};
  int b;
    cin>>b;
    for(int i=1;i<=b;i++){
        cin>>a[i];
    }
    sort(a+1,a+b+1);
    cout<<a[(b+1)/2]<<endl;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ int a[1001]={0};
  int b;
    cin>>b;
    for(int i=1;i<b;i++){
        cin>>a[i];
    }
    sort(a,a+b);
    cout<<a[(b+1)/2]<<endl;
return 0;
}


#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <algorithm>

using namespace std;

int			n;
vector<int> v;
int main(void){
	#ifndef ONLINE_JUDGE
	freopen("source.txt","r",stdin);
	#endif
	cin>>n;
	for(int i=0,x; i<n;i++){
		cin>>x;
		v.push_back(x);
	}
	int r=1;
	while(r<n){

		int max=0,min=0;
		int size=static_cast<int>(v.size());
		if(r%2){
			for(int j=1;j<size;j++){
				if(v[j]>v[max])
					max=j;
			}
			v.erase(v.begin()+max);
		}else{

			for(int j=1;j<size;j++){
				if(v[j]<v[min])
					min=j;
			}

			v.erase(v.begin()+min);
		}
	r++;

	}
	cout<<v[0]<<endl;
	return 0;
}


#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <algorithm>

using namespace std;

int			n;
vector<int> v;
int main(void){
	#ifndef ONLINE_JUDGE
	freopen("source.txt","r",stdin);
	#endif
	cin>>n;
	for(int i=0,x; i<n;i++){
		cin>>x;
		v.push_back(x);
	}
	int r=1;
	while(r==n-1){
		int max=0,min=0;
		if(r%2==1){
			for(int j=1;j<n;j++){
				if(v[j]>v[max])
					max=j;
			}
			v.erase(v.begin()+max);
		}
		if(r%2==0){
			for(int j=1;j<n;j++){
				if(v[j]<v[min])
					min=j;
			}
			v.erase(v.begin()+min);
		}
	r++;

	}
	cout<<v[0]<<endl;
	return 0;
}


#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <algorithm>

using namespace std;

int			n;
vector<int> v;
int main(void){
	#ifndef ONLINE_JUDGE
	freopen("source.txt","r",stdin);
	#endif
	cin>>n;
	for(int i=0,x; i<n;i++){
		cin>>x;
		v.push_back(x);
	}
	int r=1;
	while(r==n){
		int max=0,min=0;
		int size=static_cast<int>(v.size());
		if(r%2==1){
			for(int j=1;j<size;j++){
				if(v[j]>v[max])
					max=j;
			}
			v.erase(v.begin()+max);
		}
		if(r%2==0){

			for(int j=1;j<size;j++){
				if(v[j]<v[min])
					min=j;
			}
			v.erase(v.begin()+min);
		}
	r++;

	}
	cout<<v[0]<<endl;
	return 0;
}


#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <algorithm>

using namespace std;

int			n;
vector<int> v;
int main(void){
	#ifndef ONLINE_JUDGE
	freopen("source.txt","r",stdin);
	#endif
	cin>>n;
	for(int i=0,x; i<n;i++){
		cin>>x;
		v.push_back(x);
	}
	int r=1;
	while(r<n){

		int max=0,min=0;
		int size=static_cast<int>(v.size());
		if(r%2==0){
			for(int j=1;j<size;j++){
				if(v[j]>v[max])
					max=j;
			}
			v.erase(v.begin()+max);
		}else{

			for(int j=1;j<size;j++){
				if(v[j]<v[min])
					min=j;
			}

			v.erase(v.begin()+min);
		}
	r++;

	}
	cout<<v[0]<<endl;
	return 0;
}


#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <algorithm>

using namespace std;

int			n;
vector<int> v;
int main(void){
	#ifndef ONLINE_JUDGE
	freopen("source.txt","r",stdin);
	#endif
	cin>>n;
	for(int i=0,x; i<n;i++){
		cin>>x;
		v.push_back(x);
	}
	for(int i=1,max,min=0;i<n;i+=2){
		max=0;min=0;
		for(int j=1;j<n;j++){
			if(v[j]>max)
				max=j;
			if(v[j]<min)
				min=j;
		}
		if(max==min)
			max++;
		v.erase(v.begin()+max);
		v.erase(v.begin()+min+1);
	}
	cout<<v[0];
	return 0;
}


#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <algorithm>

using namespace std;

int			n;
vector<int> v;
int main(void){
	#ifndef ONLINE_JUDGE
	freopen("source.txt","r",stdin);
	#endif
	cin>>n;
	for(int i=0,x; i<n;i++){
		cin>>x;
		v.push_back(x);
	}
	for(int i=1,max,min=0;i<n;i+=2){
		max=0;min=0;
		for(int j=1;j<n;j++){
			if(v[j]>v[max])
				max=j;
		}
		if(max==min)
			max++;

		v.erase(v.begin()+max);
		for(int j=1;j<n;j++){
			if(v[j]<v[min])
				min=j;
		}
		v.erase(v.begin()+min);
	}
	cout<<v[0];
	return 0;
}


#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <algorithm>

using namespace std;

int			n;
vector<int> v;
int main(void){
	#ifndef ONLINE_JUDGE
	freopen("source.txt","r",stdin);
	#endif
	cin>>n;
	for(int i=0,x; i<n;i++){
		cin>>x;
		v.push_back(x);
	}
	int r=1;
	while(r==n-1){
		int max=0,min=0;
		int size=static_cast<int>(v.size());
		if(r%2==1){
			for(int j=1;j<size;j++){
				if(v[j]>v[max])
					max=j;
			}
			v.erase(v.begin()+max);
		}
		if(r%2==0){

			for(int j=1;j<size;j++){
				if(v[j]<v[min])
					min=j;
			}
			v.erase(v.begin()+min);
		}
	r++;

	}
	cout<<v[0]<<endl;
	return 0;
}