#include<bits/stdc++.h>
using namespace std;
bool helper(pair<float, float> a, pair<float, float> b){
    if(a.first == a.second){
        return a.second < b.second;
    }
    return a.first > b.first;
}
int main(){
    float n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<float, float> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<float, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        float height1 = t1*speed[i].first*(1 - (k/100)) + t2*speed[i].second;
        float height2 = t1*speed[i].second*(1 - (k/100)) + t2*speed[i].first;
        answer.push_back(make_pair(max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end(), helper);
    for(int i =0; i < answer.size(); i++){
        cout<<answer[i].second<<" "<<fixed<<setprecision(2)<<answer[i].first<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
bool helper(pair<float, float> a, pair<float, float> b){
    if(a.first == a.second){
        return a.second < b.second;
    }
    return a.first > b.first;
}
int main(){
    float n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<float, float> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<float, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        float height1 = t1*speed[i].first*(1 - (k/100)) + t2*speed[i].second;
        float height2 = t1*speed[i].second*(1 - (k/100)) + t2*speed[i].first;
        answer.push_back(make_pair(max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end(), helper);
    for(int i =0; i < answer.size(); i++){
        cout<<answer[i].second<<" "<<fixed<<setprecision(6)<<answer[i].first<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
bool helper(pair<double, int> a, pair<double, int> b){
    if(a.first == a.second){
        return a.second < b.second;
    }
    return a.first > b.first;
}
int main(){
    long long int n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<long long, long long> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<double, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        double height1 = t1*speed[i].first + t2*speed[i].second - (double(speed[i].first*k)/100);
        double height2 = t1*speed[i].second + t2*speed[i].first - (double(speed[i].second*k)/100);
        answer.push_back(make_pair(max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end(), helper);
    for(int i =0; i < answer.size(); i++){
        cout<<answer[i].second<<" "<<fixed<<setprecision(2)<<answer[i].first<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
bool helper(pair<double, int> a, pair<double, int> b){
    if(a.first == a.second){
        return a.second < b.second;
    }
    return a.first > b.first;
}
int main(){
    long long int n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<long long, long long> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<double, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        double height1 = t1*speed[i].first + t2*speed[i].second - (double(t1*speed[i].first*k)/100);
        double height2 = t1*speed[i].second + t2*speed[i].first - (double(t1*speed[i].second*k)/100);
        answer.push_back(make_pair(max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end(), helper);
    for(int i =0; i < answer.size(); i++){
        cout<<answer[i].second<<" "<<fixed<<setprecision(2)<<answer[i].first<<"\n";
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define FOR(i,a,b) for(long long int i=a;i<b;i++)
#define sz(s) (long long int)(s).size()
#define pb push_back
#define mp make_pair
const ll inf = 1000000000;
const ll MOD = 1000000007;
bool cmp(pair<double,ll> a,pair<double,ll> b){
	if(a.first < b.first)return true;
	else if(a.first == b.first)return a.first > b.second;
	else return false;
}

int main(void){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    register ll i,n;
    double k,x,y,t1,t2;
    cin>>n>>t1>>t2>>k;
    vector<pair<double,ll> > v;
    for(i=0;i<n;i++){
    	cin>>x>>y;
    	double val = max(x*t1*(100-k) + 100*y*t2, y*t1*(100-k) + 100*x*t2);
    	v.pb({val,i+1});
    }
    sort(v.begin(),v.end(),cmp);
    ll count = 1;
    // for(i=n-1;i<n;i++){
    // 	printf("%lld %.2f\n",v[i].second,v[i].first);
    // 	count++;
    // }
    // cout<<"---";

    for(i=n-1;i>=0;i--){
    	printf("%lld %.2f\n",v[i].second,v[i].first/100.00);
    	count++;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define FOR(i,a,b) for(long long int i=a;i<b;i++)
#define sz(s) (long long int)(s).size()
#define pb push_back
#define mp make_pair
const ll inf = 1000000000;
const ll MOD = 1000000007;
bool cmp(pair<ll,ll> a,pair<ll,ll> b){
	if(a.first > b.first)return true;
	else if(a.first == b.first)return a.first < b.second;
	else return false;
}

int main(void){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    register ll i,n;
    ll k,x,y,t1,t2;
    cin>>n>>t1>>t2>>k;
    vector<pair<ll,ll> > v;
    for(i=0;i<n;i++){
    	cin>>x>>y;
    	ll val = max(x*t1*(100-k) + 100*y*t2, y*t1*(100-k) + 100*x*t2);
    	v.pb({val,i+1});
    }
    sort(v.begin(),v.end(),cmp);
    ll count = 1;
    // for(i=n-1;i<n;i++){
    // 	printf("%lld %.2f\n",v[i].second,v[i].first);
    // 	count++;
    // }
    // cout<<"---";

    for(i=0;i<n;i++){
    	printf("%lld %.2f\n",v[i].second,(double)v[i].first/100.00);
    	count++;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define FOR(i,a,b) for(long long int i=a;i<b;i++)
#define sz(s) (long long int)(s).size()
#define pb push_back
#define mp make_pair
const ll inf = 1000000000;
const ll MOD = 1000000007;
bool cmp(pair<ll,ll> a,pair<ll,ll> b){
	if(a.first > b.first)return true;
	else if(a.first == b.first)return a.second < b.second;
	else return false;
}

int main(void){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    register ll i,n;
    ll k,x,y,t1,t2;
    cin>>n>>t1>>t2>>k;
    vector<pair<ll,ll> > v;
    for(i=0;i<n;i++){
    	cin>>x>>y;
    	ll val = max(x*t1*(100-k) + 100*y*t2, y*t1*(100-k) + 100*x*t2);
    	v.pb({val,i+1});
    	// v.pb({x,i+1});
    }
    sort(v.begin(),v.end(),cmp);
    // for(i=n-1;i<n;i++){
    // 	printf("%lld %.2f\n",v[i].second,v[i].first);
    // 	count++;
    // }
    // cout<<"---";

    for(i=0;i<n;i++){
    	printf("%lld %.2f\n",v[i].second,(double)v[i].first/100.00);
    	// cout<<v[i].first<<" "<<v[i].second<<"\n";
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define FOR(i,a,b) for(long long int i=a;i<b;i++)
#define sz(s) (long long int)(s).size()
#define pb push_back
#define mp make_pair
const ll inf = 1000000000;
const ll MOD = 1000000007;
bool cmp(pair<double,ll> a,pair<double,ll> b){
	if(a.first < b.first)return true;
	else if(int(a.first*1000) == int(b.first*1000) )return a.first > b.second;
	else return false;
}

int main(void){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    register ll i,n;
    double k,x,y,t1,t2;
    cin>>n>>t1>>t2>>k;
    vector<pair<double,ll> > v;
    for(i=0;i<n;i++){
    	cin>>x>>y;
    	double val = max(x*t1*(100-k)/100 + y*t2, y*t1*(100-k)/100 + x*t2);
    	v.pb({val,i+1});
    }
    sort(v.begin(),v.end(),cmp);
    ll count = 1;
    // for(i=n-1;i<n;i++){
    // 	printf("%lld %.2f\n",v[i].second,v[i].first);
    // 	count++;
    // }
    // cout<<"---";

    for(i=n-1;i>=0;i--){
    	printf("%lld %.2f\n",v[i].second,v[i].first);
    	count++;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define FOR(i,a,b) for(long long int i=a;i<b;i++)
#define sz(s) (long long int)(s).size()
#define pb push_back
#define mp make_pair
const ll inf = 1000000000;
const ll MOD = 1000000007;
bool cmp(pair<double,ll> a,pair<double,ll> b){
	if(a.first > b.first)return true;
	else if(a.first == b.first)return a.first < b.second;
	else return false;
}

int main(void){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    register ll i,n;
    double k,x,y,t1,t2;
    cin>>n>>t1>>t2>>k;
    vector<pair<double,ll> > v;
    for(i=0;i<n;i++){
    	cin>>x>>y;
    	double val = max(x*t1*(100-k) + 100*y*t2, y*t1*(100-k) + 100*x*t2);
    	v.pb({val,i+1});
    }
    sort(v.begin(),v.end(),cmp);
    ll count = 1;
    // for(i=n-1;i<n;i++){
    // 	printf("%lld %.2f\n",v[i].second,v[i].first);
    // 	count++;
    // }
    // cout<<"---";

    for(i=0;i<n;i++){
    	printf("%lld %.2f\n",v[i].second,v[i].first/100.00);
    	count++;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define FOR(i,a,b) for(long long int i=a;i<b;i++)
#define sz(s) (long long int)(s).size()
#define pb push_back
#define mp make_pair
const ll inf = 1000000000;
const ll MOD = 1000000007;

int main(void){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    register ll i,n;
    double k,x,y,t1,t2;
    cin>>n>>t1>>t2>>k;
    vector<double> v;
    for(i=0;i<n;i++){
    	cin>>x>>y;
    	double val = max(x*t1*k/100 + y*t2, y*t1*k/100 + x*t2);
    	v.pb(val);
    }
    // cout<<v.size();
    sort(v.begin(),v.end());
    ll count = 1;
    for(i=n-1;i>=0;i--){
    	printf("%lld %f\n",count,v[i]);
    	// cout<<count<<" "<<v[i]<<"\n";
    	count++;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define FOR(i,a,b) for(long long int i=a;i<b;i++)
#define sz(s) (long long int)(s).size()
#define pb push_back
#define mp make_pair
const ll inf = 1000000000;
const ll MOD = 1000000007;
bool cmp(pair<double,ll> a,pair<double,ll> b){
	if(a.first < b.first)return true;
	else if(a.first == b.first)return a.first > b.second;
	else return false;
}

int main(void){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    register ll i,n;
    double k,x,y,t1,t2;
    cin>>n>>t1>>t2>>k;
    vector<pair<double,ll> > v;
    for(i=0;i<n;i++){
    	cin>>x>>y;
    	double val = max(x*t1*(100-k)/100 + y*t2, y*t1*(100-k)/100 + x*t2);
    	v.pb({val,i+1});
    }
    sort(v.begin(),v.end(),cmp);
    ll count = 1;
    // for(i=n-1;i<n;i++){
    // 	printf("%lld %.2f\n",v[i].second,v[i].first);
    // 	count++;
    // }
    // cout<<"---";

    for(i=n-1;i>=0;i--){
    	printf("%lld %.2f\n",v[i].second,v[i].first);
    	count++;
    }
}


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

bool sortinrev (const pair<int,int> &a, const pair<int,int> &b)
{
	return a.first>b.first;
}

int main() {
	// your code goes here
	double n,t1,t2,k,i,j,ans,u,v,a,b;
	cin>>n>>t1>>t2>>k;
	k=100-k;
	for(i=1;i<=n;i++)
	{
		cin>>a>>b;
	    u= min(a,b);
	    v=max(a,b);
	    ans=max(u*t1*k/100+v*t2,v*t1*k/100+u*t1);
		vec.push_back(make_pair(ans,i));
	}
	sort(vec.begin(),vec.end(),sortinrev);
	vector<pair<double,int>>::iterator it;
	for(it=vec.begin();it!=vec.end();it++)
	{
		cout<<it->second<<" ";
		printf("%.10lf\n",it->first);
	}

	return 0;
}


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

bool sortinrev (const pair<double,int> &a, const pair<double,int> &b)
{
	return a.first>b.first;
}

int main() {
	// your code goes here
	double n,t1,t2,k,i,j,ans,u,v,a,b;
	cin>>n>>t1>>t2>>k;
	k=100-k;
	for(i=1;i<=n;i++)
	{
		cin>>a>>b;
	    u= min(a,b);
	    v=max(a,b);
	    ans=max(u*t1*k/100+v*t2,v*t1*k/100+u*t1);
		vec.push_back(make_pair(ans,i));
	}
	sort(vec.begin(),vec.end(),sortinrev);
	vector<pair<double,int>>::iterator it;
	for(it=vec.begin();it!=vec.end();it++)
	{
		cout<<it->second<<" ";
		printf("%.10lf\n",it->first);
	}

	return 0;
}


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

bool sortinrev (const pair<double,int> &a, const pair<double,int> &b)
{
	return a.first>b.first;
}

int main() {
	// your code goes here
	double n,t1,t2,k,i,j,ans,u,v,a,b;
	cin>>n>>t1>>t2>>k;
	k=100-k;
	for(i=1;i<=n;i++)
	{
		cin>>a>>b;
	    u= min(a,b);
	    v=max(a,b);
	    ans=max(u*t1*k/100+v*t2,v*t1*k/100+u*t2);
		vec.push_back(make_pair(ans,i));
	}
	sort(vec.begin(),vec.end(),sortinrev);
	vector<pair<double,int>>::iterator it;
	for(it=vec.begin();it!=vec.end();it++)
	{
		cout<<it->second<<" ";
		printf("%.2lf\n",it->first);
	}

	return 0;
}


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

bool sortinrev (const pair<double,int> &a, const pair<double,int> &b)
{
	if(a.first==b.first)
	return a.second<b.second;
	return a.first>b.first;
}

int main() {
	// your code goes here
	double n,t1,t2,k,i,j,ans,u,v,a,b;
	cin>>n>>t1>>t2>>k;
	k=100-k;
	for(i=1;i<=n;i++)
	{
		cin>>a>>b;
	    u= min(a,b);
	    v=max(a,b);
	    ans=max(u*t1*k/100+v*t2,v*t1*k/100+u*t2);
		vec.push_back(make_pair(ans,i));
	}
	sort(vec.begin(),vec.end(),sortinrev);
	vector<pair<double,int>>::iterator it;
	for(it=vec.begin();it!=vec.end();it++)
	{
		cout<<it->second<<" ";
		printf("%.2lf\n",it->first);
	}

	return 0;
}


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

bool sortinrev (const pair<double,int> &a, const pair<double,int> &b)
{
	return a.first>b.first;
}

int main() {
	// your code goes here
	double n,t1,t2,k,i,j,ans,u,v,a,b;
	cin>>n>>t1>>t2>>k;
	k=100-k;
	for(i=1;i<=n;i++)
	{
		cin>>a>>b;
	    u= min(a,b);
	    v=max(a,b);
	    ans=max(u*t1*k/100+v*t2,v*t1*k/100+u*t1);
		vec.push_back(make_pair(ans,i));
	}
	sort(vec.begin(),vec.end(),sortinrev);
	vector<pair<double,int>>::iterator it;
	for(it=vec.begin();it!=vec.end();it++)
	{
		cout<<it->second<<" ";
		printf("%.2lf\n",it->first);
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define ld long double

#define pll pair<long,long>

#define vpll vector<pll>

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
    ll n;
    ld t1,t2;
    ld k;

    cin >> n >> t1 >> t2 >> k;

    ll i;
    ld a[n][2];
    for(i=0;i<n;i++)
    {
        cin >> a[i][0] >> a[i][1];
    }

    k/=100;
    k=1-k;

    vector<pair<ld,ll>> b;ld x;
    for(i=0;i<n;i++)
    {
        if( ((a[i][0]*t1*k)+(t2*a[i][1]))>((a[i][1]*t1*k)+(t2*a[i][0])) )
        {
            x=(a[i][0]*t1*k)+(t2*a[i][1]);
        }
        else
        {
            x=(a[i][1]*t1*k)+(t2*a[i][0]);
        }

        b.push_back({x,i+1});
    }

    sort(b.begin(),b.end(),sortinrev);

    for(i=0;i<n;i++)
    {
        cout << b[i].second << " " << fixed << setprecision(2) << b[i].first << "\n";
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define ld long double

#define pll pair<long,long>

#define vpll vector<pll>

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
    ll n,t1,t2,k;

    cin >> n >> t1 >> t2 >> k;

    ll i;
    ld a[n][2];
    for(i=0;i<n;i++)
    {
        cin >> a[i][0] >> a[i][1];
    }

    vector<pair<ld,ll>> b;
    ld x1,x2;
    for(i=0;i<n;i++)
    {
        x1=a[i][0]*t1*(100-k)+t2*a[i][1]*100;
        x2=a[i][1]*t1*(100-k)+t2*a[i][0]*100;

        b.push_back({-1*max(x1,x2),i+1});
    }

    sort(b.begin(),b.end());

    for(i=0;i<n;i++)
    {
        cout << b[i].second << " " << fixed << setprecision(2) << -0.01*b[i].first << "\n";
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define ld long double

#define pll pair<long,long>

#define vpll vector<pll>

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
    ll n;
    ld t1,t2;
    ld k;

    cin >> n >> t1 >> t2 >> k;

    ll i;
    ld a[n][2];
    for(i=0;i<n;i++)
    {
        cin >> a[i][0] >> a[i][1];
    }

    k/=100;
    k=1-k;

    vector<pair<ld,ll>> b;ld x;
    for(i=0;i<n;i++)
    {
        if( ((a[i][0]*t1*k)+(t2*a[i][1]))>((a[i][1]*t1*k)+(t2*a[i][0])) )
        {
            x=(a[i][0]*t1*k)+(t2*a[i][1]);
        }
        else
        {
            x=(a[i][1]*t1*k)+(t2*a[i][0]);
        }

        b.push_back({-1*x,i+1});
    }

    sort(b.begin(),b.end(),sortinrev);

    for(i=0;i<n;i++)
    {
        printf("%lld %.2Lf\n",b[i].second,-1*b[i].first);
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define ld long double

#define pll pair<long,long>

#define vpll vector<pll>

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
    ll n;
    ld t1,t2;
    ld k;

    cin >> n >> t1 >> t2 >> k;

    ll i;
    ld a[n][2];
    for(i=0;i<n;i++)
    {
        cin >> a[i][0] >> a[i][1];
    }

    k/=100;
    k=1-k;

    vector<pair<ld,ll>> b;ld x;
    for(i=0;i<n;i++)
    {
        if( ((a[i][0]*t1*k)+(t2*a[i][1]))>((a[i][1]*t1*k)+(t2*a[i][0])) )
        {
            x=(a[i][0]*t1*k)+(t2*a[i][1]);
        }
        else
        {
            x=(a[i][1]*t1*k)+(t2*a[i][0]);
        }

        b.push_back({x,i+1});
    }

    stable_sort(b.begin(),b.end(),sortinrev);

    for(i=0;i<n;i++)
    {
        printf("%lld %.2Lf\n",b[i].second,b[i].first);
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define ld long double

#define pll pair<long,long>

#define vpll vector<pll>

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
    ll n,t1,t2,k;

    cin >> n >> t1 >> t2 >> k;

    ll i;
    ld a[n][2];
    for(i=0;i<n;i++)
    {
        cin >> a[i][0] >> a[i][1];
    }

    vector<pair<ld,ll>> b;
    ld x;
    for(i=0;i<n;i++)
    {
        if( a[i][0]<a[i][1] )
        {
            x=a[i][0]*t1*(100-k)+t2*a[i][1]*100;
        }
        else
        {
            x=a[i][1]*t1*(100-k)+t2*a[i][0]*100;
        }

        b.push_back({x,i+1});
    }

    sort(b.begin(),b.end(),sortinrev);

    for(i=0;i<n;i++)
    {
        cout << b[i].second << " " << fixed << setprecision(2) << 0.01*b[i].first << "\n";
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define ld long double

#define pll pair<long,long>

#define vpll vector<pll>

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
    ll n,t1,t2,k;

    cin >> n >> t1 >> t2 >> k;

    ll i;
    ld a[n][2];
    for(i=0;i<n;i++)
    {
        cin >> a[i][0] >> a[i][1];
    }

    vector<pair<ld,ll>> b;
    ld x1,x2;
    for(i=0;i<n;i++)
    {
        x1=a[i][0]*t1*(100-k)+t2*a[i][1]*100;
        x2=a[i][1]*t1*(100-k)+t2*a[i][0]*100;

        b.push_back({max(x1,x2),i+1});
    }

    sort(b.begin(),b.end(),sortinrev);

    for(i=0;i<n;i++)
    {
        cout << b[i].second << " " << fixed << setprecision(2) << 0.01*b[i].first << "\n";
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long

#define ld long double

#define pll pair<long,long>

#define vpll vector<pll>

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
    ll n;
    ld t1,t2;
    ld k;

    cin >> n >> t1 >> t2 >> k;

    ll i;
    ld a[n][2];
    for(i=0;i<n;i++)
    {
        cin >> a[i][0] >> a[i][1];
    }

    k/=100;
    k=1-k;

    vector<pair<ld,ll>> b;ld x;
    for(i=0;i<n;i++)
    {
        if( a[i][0]<a[i][1] )
        {
            x=(a[i][0]*t1*k)+(t2*a[i][1]);
        }
        else
        {
            x=(a[i][1]*t1*k)+(t2*a[i][0]);
        }

        b.push_back({x,i+1});
    }

    sort(b.begin(),b.end(),sortinrev);

    for(i=0;i<n;i++)
    {
        cout << b[i].second << " " << fixed << setprecision(2) << b[i].first << "\n";
    }

    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
    int n, t1, t2;
    double k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<double, int>> s;
    for(int i=1; i<=n; i++){
        int a, b;
        cin >> a >> b;
        s.push_back(make_pair((-1)*max((((a*t1)-(a*t1*(k/100.0))) + (b*t2)), (((b*t1)-(b*t1*(k/100.0))) + (a*t2))), i));
    }
    sort(s.begin(), s.end());
    for (int i=0; i<n; i++)
    {
        cout << s[i].second << " "
             << (-1)*s[i].first << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
int main()
{
    int n, t1, t2;
    float k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<float, int>> s;
    for(int i=1; i<=n; i++){
        int a, b;
        cin >> a >> b;
        s.push_back(make_pair((-1)*max((((a*t1)-(a*t1*(k/100.0))) + (b*t2)), (((b*t1)-(b*t1*(k/100.0))) + (a*t2))), i));
    }
    sort(s.begin(), s.end());
    for (int i=0; i<n; i++)
    {
        cout << s[i].second << " "
             <<fixed<<setprecision(2)<< (-1)*s[i].first << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
int main()
{
    int n, t1, t2;
    float k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<float, int>> s;
    for(int i=1; i<=n; i++){
        int a, b;
        cin >> a >> b;
        s.push_back(make_pair((-1)*(min(a, b)*t1*(1-k/100) + max(a, b)*t2), i));
    }
    sort(s.begin(), s.end());
    for (int i=0; i<n; i++)
    {
        cout << s[i].second << " "
             << fixed << setprecision(2) << (-1)*s[i].first << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
    int n, t1, t2;
    float k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<float, int>> s;
    for(int i=1; i<=n; i++){
        int a, b;
        cin >> a >> b;
        s.push_back(make_pair((-1)*max((((a*t1)-(a*t1*(k/100.0))) + (b*t2)), (((b*t1)-(b*t1*(k/100.0))) + (a*t2))), i));
    }
    sort(s.begin(), s.end());
    for (int i=0; i<n; i++)
    {
        cout << s[i].second << " "
             << (-1)*s[i].first << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
int main()
{
    int n, t1, t2;
    double k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<double, int>> s;
    for(int i=1; i<=n; i++){
        int a, b;
        cin >> a >> b;
        s.push_back(make_pair((-1)*max((((a*t1)-(a*t1*(k/100.0))) + (b*t2)), (((b*t1)-(b*t1*(k/100.0))) + (a*t2))), i));
    }
    sort(s.begin(), s.end());
    for (int i=0; i<n; i++)
    {
        cout << s[i].second << " "
             << fixed<<setprecision(2)<<(-1)*s[i].first << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
    int n, t1, t2;
    float k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<float, int>> s;
    for(int i=1; i<=n; i++){
        int a, b;
        cin >> a >> b;
        s.push_back(make_pair((-1)*(min(a, b)*t1*(1-k/100) + max(a, b)*t2), i));
    }
    sort(s.begin(), s.end());
    for (int i=0; i<n; i++)
    {
        cout << s[i].second << " "
             << (-1)*s[i].first << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define x first
#define y second
#define PID pair < int , double >
#define PLL pair < ll , ll >

using namespace std;
int n;
double t1, t2, k, X, Y;
PID a[100100];
bool cmp(PID a, PID b)
{
    return ((a.x > b.x) || (a.x == b.x && a.y < b.y));
}
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> t1 >> t2 >> k;
    for (int i = 1; i <= n; i++)
    {
        cin >> X >> Y;
        if (Y < X) swap(X, Y);
        a[i].y = i;
        a[i].x = (X * t1 * (100 - k)) / 100 + Y * t2;
    }
    sort(a+1, a+n+1, cmp);
    cout << setprecision(2) << fixed;
    for (int i = 1; i <= n; i++) cout << a[i].y << " " << a[i].x << "\n";
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define x first
#define y second
#define PID pair < double , int >
#define PLL pair < ll , ll >

using namespace std;
int n;
double t1, t2, k, X, Y;
PID a[100100];
bool cmp(PID a, PID b)
{
    return ((a.x > b.x) || (a.x == b.x && a.y < b.y));
}
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> t1 >> t2 >> k;
    for (int i = 1; i <= n; i++)
    {
        cin >> X >> Y;
        if (Y < X) swap(X, Y);
        a[i].y = i;
        a[i].x = max((X * t1 * (100 - k)) / 100 + Y * t2,(Y * t1 * (100 - k)) / 100 + X * t2 );
    }
    sort(a+1, a+n+1, cmp);
    for (int i = 1; i <= n; i++) cout << a[i].y << " " << setprecision (2) << fixed << a[i].x << "\n";
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define x first
#define y second
#define PID pair < double , int >
#define PLL pair < ll , ll >

using namespace std;
int n;
double t1, t2, k, X, Y;
PID a[100100];
bool cmp(PID a, PID b)
{
    return ((a.x > b.x) || (a.x == b.x && a.y < b.y));
}
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> t1 >> t2 >> k;
    for (int i = 1; i <= n; i++)
    {
        cin >> X >> Y;
        if (Y < X) swap(X, Y);
        a[i].y = i;
        a[i].x = (X * t1 * (100 - k)) / 100 + Y * t2;
    }
    sort(a+1, a+n+1, cmp);
    for (int i = 1; i <= n; i++) cout << a[i].y << " " << 1.00*a[i].x << "\n";
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define x first
#define y second
#define PDD pair < double , double >
#define PLL pair < ll , ll >

using namespace std;
int n;
double t1, t2, k, X, Y;
PDD a[100100];
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> t1 >> t2 >> k;
    for (int i = 1; i <= n; i++)
    {
        cin >> X >> Y;
        if (Y < X) swap(X, Y);
        a[i].y = i;
        a[i].x = (X * t1 * (100 - k)) / 100 + Y * t2;
    }
    sort(a+1, a+n+1);
    reverse(a+1, a+n+1);
    cout << setprecision(2) << fixed;
    for (int i = 1; i <= n; i++) cout << a[i].y << " " << a[i].x << "\n";
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define x first
#define y second
#define PID pair < double , int >
#define PLL pair < ll , ll >

using namespace std;
int n;
double t1, t2, k, X, Y;
PID a[100100];
bool cmp(PID a, PID b)
{
    return ((a.x > b.x) || (a.x == b.x && a.y < b.y));
}
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> t1 >> t2 >> k;
    for (int i = 1; i <= n; i++)
    {
        cin >> X >> Y;
        if (Y < X) swap(X, Y);
        a[i].y = i;
        a[i].x = (X * t1 * (100 - k)) / 100 + Y * t2;
    }
    sort(a+1, a+n+1, cmp);
    for (int i = 1; i <= n; i++) cout << a[i].y << " " << setprecision (2) << fixed << a[i].x << "\n";
}


#include<bits/stdc++.h>

#define ll            long long
#define pb            push_back
#define si            set <int>
#define F             first
#define S             second
#define mii           map<int ,int >
#define msi           map<string,int >
#define mis           map<int , string>
#define fr(i,a,b)     for(int  i=a;i<=b;i++)
#define loop(i,n)     for(int i=0;i<n;i++)
#define all(v)        v.begin(),v.end()
#define vi            vector<int >
#define vpi           vector<pair<int , int >>
#define vs            vector<string>
#define sz(x)         (int )x.size()
#define M             1000000007
#define mp            make_pair
#define input(arr,n)  loop(i,n) cin>>arr[i]
#define output(arr,n) loop(i,n) cout<<arr[i]<<" "
#define mod           998244353
#define sof           sizeof

using namespace std;

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a, int b){
	return (a*b)/gcd(a,b);
}

bool comp(const pair<int,int> &a,const pair<int,int> &b){
  if(a.S==b.S) return a.F<b.F;
  else return a.S>b.S;
}

void solve(int t){

	int n;
	double t1,t2,k;
	cin>>n;
	cin>>t1>>t2>>k;
	vector<pair<int,double>> order;
	int v,u;
	double a,b;
	fr(i,1,n){
		cin>>v>>u;
		a=v*t1*(100-k)/100 + u*t2;
		b=u*t1*(100-k)/100 + v*t2;
		order.pb(mp(i,max(a,b)));

	}
	sort(order.begin(),order.end(),comp);
	loop(i,n) cout<<order[i].F<<" "<<fixed<<setprecision(2)<<order[i].S<<"\n";

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	//if(sieve[31]) cout<<"chal rha";
	int t;
   	t=1;
    	//cin>>t;
    	loop(i,t){

     		solve(i);
    	}

    	return 0;

}


#include<bits/stdc++.h>

#define ll            long long
#define pb            push_back
#define si            set <int>
#define F             first
#define S             second
#define mii           map<int ,int >
#define msi           map<string,int >
#define mis           map<int , string>
#define fr(i,a,b)     for(int  i=a;i<=b;i++)
#define loop(i,n)     for(int i=0;i<n;i++)
#define all(v)        v.begin(),v.end()
#define vi            vector<int >
#define vpi           vector<pair<int , int >>
#define vs            vector<string>
#define sz(x)         (int )x.size()
#define M             1000000007
#define mp            make_pair
#define input(arr,n)  loop(i,n) cin>>arr[i]
#define output(arr,n) loop(i,n) cout<<arr[i]<<" "
#define mod           998244353
#define sof           sizeof

using namespace std;

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a, int b){
	return (a*b)/gcd(a,b);
}

bool comp(const pair<int,int> &a,const pair<int,int> &b){
  if(a.S==b.S) return a.F<b.F;
  else return a.S>b.S;
}

void solve(int t){

	int n;
	float t1,t2,k;
	cin>>n;
	cin>>t1>>t2>>k;
	vector<pair<int,float>> order;
	int v,u;
	float a=0,b=0;
	fr(i,1,n){
		cin>>v>>u;
		a=v*t1*(100-k)/100 + u*t2;
		b=u*t2*(100-k)/100 + v*t2;
		order.pb(mp(i,max(a,b)));

	}
	sort(order.begin(),order.end(),comp);
	loop(i,n) cout<<order[i].F<<" "<<fixed<<setprecision(2)<<order[i].S<<"\n";

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	//if(sieve[31]) cout<<"chal rha";
	int t;
   	t=1;
    	//cin>>t;
    	loop(i,t){

     		solve(i);
    	}

    	return 0;

}


#include<bits/stdc++.h>

#define ll            long long
#define pb            push_back
#define si            set <int>
#define F             first
#define S             second
#define mii           map<int ,int >
#define msi           map<string,int >
#define mis           map<int , string>
#define fr(i,a,b)     for(int  i=a;i<=b;i++)
#define loop(i,n)     for(int i=0;i<n;i++)
#define all(v)        v.begin(),v.end()
#define vi            vector<int >
#define vpi           vector<pair<int , int >>
#define vs            vector<string>
#define sz(x)         (int )x.size()
#define M             1000000007
#define mp            make_pair
#define input(arr,n)  loop(i,n) cin>>arr[i]
#define output(arr,n) loop(i,n) cout<<arr[i]<<" "
#define mod           998244353
#define sof           sizeof

using namespace std;

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a, int b){
	return (a*b)/gcd(a,b);
}

bool comp(const pair<int,double> &a,const pair<int,double> &b){
  if(a.S==b.S) return a.F<b.F;
  else return a.S>b.S;
}

void solve(int t){

	int n;
	double t1,t2,k;
	cin>>n;
	cin>>t1>>t2>>k;
	vector<pair<int,double>> order;
	int v,u;
	double a,b;
	fr(i,1,n){
		cin>>v>>u;
		a=v*t1*(100-k)/100 + u*t2;
		b=u*t1*(100-k)/100 + v*t2;
		order.pb(mp(i,max(a,b)));

	}
	sort(order.begin(),order.end(),comp);
	loop(i,n) cout<<order[i].F<<" "<<fixed<<setprecision(2)<<order[i].S<<"\n";

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	//if(sieve[31]) cout<<"chal rha";
	int t;
   	t=1;
    	//cin>>t;
    	loop(i,t){

     		solve(i);
    	}

    	return 0;

}


#include<bits/stdc++.h>

#define ll            long long
#define pb            push_back
#define si            set <int>
#define F             first
#define S             second
#define mii           map<int ,int >
#define msi           map<string,int >
#define mis           map<int , string>
#define fr(i,a,b)     for(int  i=a;i<=b;i++)
#define loop(i,n)     for(int i=0;i<n;i++)
#define all(v)        v.begin(),v.end()
#define vi            vector<int >
#define vpi           vector<pair<int , int >>
#define vs            vector<string>
#define sz(x)         (int )x.size()
#define M             1000000007
#define mp            make_pair
#define input(arr,n)  loop(i,n) cin>>arr[i]
#define output(arr,n) loop(i,n) cout<<arr[i]<<" "
#define mod           998244353
#define sof           sizeof

using namespace std;

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a, int b){
	return (a*b)/gcd(a,b);
}

bool comp(const pair<int,int> &a,const pair<int,int> &b){
  if(a.S!=b.S) return a.S>b.S;
  else return a.F<b.F;
}

void solve(int t){

	int n;
	float t1,t2,k;
	cin>>n;
	cin>>t1>>t2>>k;
	vector<pair<int,float>> order;
	int v,u;
	float a=0,b=0;
	fr(i,1,n){
		cin>>v>>u;
		a=v*t1*(100-k)/100 + u*t2;
		b=u*t2*(100-k)/100 + v*t2;
		order.pb(mp(i,max(a,b)));

	}
	sort(order.begin(),order.end(),comp);
	loop(i,n) cout<<order[i].F<<" "<<fixed<<setprecision(2)<<order[i].S<<"\n";

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	//if(sieve[31]) cout<<"chal rha";
	int t;
   	t=1;
    	//cin>>t;
    	loop(i,t){

     		solve(i);
    	}

    	return 0;

}


#include<bits/stdc++.h>

#define ll            long long
#define pb            push_back
#define si            set <int>
#define F             first
#define S             second
#define mii           map<int ,int >
#define msi           map<string,int >
#define mis           map<int , string>
#define fr(i,a,b)     for(int  i=a;i<=b;i++)
#define loop(i,n)     for(int i=0;i<n;i++)
#define all(v)        v.begin(),v.end()
#define vi            vector<int >
#define vpi           vector<pair<int , int >>
#define vs            vector<string>
#define sz(x)         (int )x.size()
#define M             1000000007
#define mp            make_pair
#define input(arr,n)  loop(i,n) cin>>arr[i]
#define output(arr,n) loop(i,n) cout<<arr[i]<<" "
#define mod           998244353
#define sof           sizeof

using namespace std;

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a, int b){
	return (a*b)/gcd(a,b);
}

bool comp(const pair<int,int> &a,const pair<int,int> &b){
  if(a.S==b.S) return a.F<b.F;
  else return a.S>b.S;
}

void solve(int t){

	int n;
	float t1,t2,k;
	cin>>n;
	cin>>t1>>t2>>k;
	vector<pair<int,float>> order;
	int v,u;
	float a=0,b=0;
	fr(i,1,n){
		cin>>v>>u;
		a=v*t1*(100-k)/100 + u*t2;
		b=u*t1*(100-k)/100 + v*t2;
		order.pb(mp(i,max(a,b)));

	}
	sort(order.begin(),order.end(),comp);
	loop(i,n) cout<<order[i].F<<" "<<fixed<<setprecision(2)<<order[i].S<<"\n";

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	//if(sieve[31]) cout<<"chal rha";
	int t;
   	t=1;
    	//cin>>t;
    	loop(i,t){

     		solve(i);
    	}

    	return 0;

}


#include <bits/stdc++.h>
using namespace std;
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
}
bool in(int &x) {
//	return scanf("%lf", &x);		// double
	return scanf("%d", &x);			// int
//	return scanf("%lld", &x);			// long long int
}
void ot(int x) {
	printf("%d ", x);
//	printf("%lld ", x);		//  	long long int
//	printf("%.3lf ", x);
}
#define pb push_back
#define mem(a,b) memset(a,b,sizeof(a))
const int N = 1e3 + 5;
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<int, int> ii;

bool cmp(pair<double, int> b, pair<double, int> a) {
	if (a.first - 0.009 < b.first - 0.009)
		return 1;
	else if (a.first - 0.009 == b.first - 0.009)
		return a.first > b.first;
	return 0;
}

int main() {
	file();
	int n, t1, t2, k, a, b;
	pair<double, int> ar[1001];
	in(n), in(t1), in(t2), in(k);
	double per = (double) (100 - k) / 100.0;
	for (int i = 0; i < n and in(a) and in(b); ++i)
		ar[i].first = max((a * t1 * per) + (b * t2), (a * t2) + (b * t1 * per)), ar[i].second =
				i + 1;
	sort(ar, ar + n, cmp);
	for (int i = 0; i < n; ++i)
		printf("%d %.2lf\n", ar[i].second, ar[i].first);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
}
bool in(int &x) {
//	return scanf("%lf", &x);		// double
	return scanf("%d", &x);			// int
//	return scanf("%lld", &x);			// long long int
}
void ot(int x) {
	printf("%d ", x);
//	printf("%lld ", x);		//  	long long int
//	printf("%.3lf ", x);
}
#define pb push_back
#define mem(a,b) memset(a,b,sizeof(a))
const int N = 1e3 + 5;
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<int, int> ii;

bool cmp(pair<double, int> b, pair<double, int> a) {
	if (a.first == b.first)
		return a.second > b.second;
	else
		return a.first < b.first;
}

int main() {
	file();
	int n, t1, t2, k, a, b, cnt = 0;
	vector<pair<double, int>> ar;
	in(n), in(t1), in(t2), in(k);
	double per = (double) (100 - k) / 100.0;
	for (int i = 0; i < n; ++i) {
		in(a), in(b);
		ar.pb( { max((a * t1 * per) + (b * t2), (a * t2) + (b * t1 * per)),
				++cnt });
	}
	sort(ar.begin(), ar.end(), cmp);
	for (int i = 0; i < (int) ar.size(); ++i)
		printf("%d %.2lf\n", ar[i].second, ar[i].first);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
}
bool in(int &x) {
//	return scanf("%lf", &x);		// double
	return scanf("%d", &x);			// int
//	return scanf("%lld", &x);			// long long int
}
void ot(int x) {
	printf("%d ", x);
//	printf("%lld ", x);		//  	long long int
//	printf("%.3lf ", x);
}
#define pb push_back
#define mem(a,b) memset(a,b,sizeof(a))
const int N = 1e3 + 5;
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<int, int> ii;

bool cmp(pair<double, int> b, pair<double, int> a) {
	if (a.first - 0.009 < b.first - 0.009)
		return 1;
	else if (a.first - 0.009 == b.first - 0.009)
		return a.first > b.first;
	return 0;
}

vector<pair<double, int>> ar;
int n, t1, t2, k, a, b;

int main() {
	file();
	in(n), in(t1), in(t2), in(k);
	double per = (double) (100 - k) / 100.0;
	for (int i = 0; i < n and in(a) and in(b); ++i)
		ar.pb(
				{ max((a * t1 * per) + (b * t2), (a * t2) + (b * t1 * per)), i
						+ 1 });
	sort(ar.begin(), ar.end(), cmp);
	for (int i = 0; i < (int) ar.size(); ++i)
		printf("%d %.2lf\n", ar[i].second, ar[i].first);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
}
bool in(int &x) {
//	return scanf("%lf", &x);		// double
	return scanf("%d", &x);			// int
//	return scanf("%lld", &x);			// long long int
}
void ot(int x) {
	printf("%d ", x);
//	printf("%lld ", x);		//  	long long int
//	printf("%.3lf ", x);
}
#define pb push_back
#define mem(a,b) memset(a,b,sizeof(a))
const int N = 1e3 + 5;
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<int, int> ii;

bool cmp(pair<double, int> b, pair<double, int> a) {
	if (a.first == b.first)
			return a.second > b.second;
	else
		return a.first < b.first;
}

int main() {
	file();
	int n, t1, t2, k, a, b, cnt = 0;
	vector<pair<double, int>> ar;
//	in(n), in(t1), in(t2), in(k);
	cin >> n >> t1 >> t2 >> k;
	double per = (double) (100 - k) / 100.0;
	for (int i = 0; i < n; ++i) {
		in(a), in(b);
		ar.pb( { max((a * t1 * per) + (b * t2), (a * t2) + (b * t1 * per)),
				++cnt });
	}
	sort(ar.begin(), ar.end(), cmp);
	for (int i = 0; i < (int) ar.size(); ++i)
		cout << ar[i].second << " " << fixed << setprecision(2) << ar[i].first
				<< endl;
//		printf("%d %.2lf\n", ar[i].second, ar[i].first);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
}
bool in(int &x) {
//	return scanf("%lf", &x);		// double
	return scanf("%d", &x);			// int
//	return scanf("%lld", &x);			// long long int
}
void ot(int x) {
	printf("%d ", x);
//	printf("%lld ", x);		//  	long long int
//	printf("%.3lf ", x);
}
#define pb push_back
#define mem(a,b) memset(a,b,sizeof(a))
const int N = 1e3 + 5;
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<int, int> ii;

bool cmp(pair<double, int> b, pair<double, int> a) {
	if (a.first - 0.009 < b.first - 0.009)
		return 1;
	else if (a.first - 0.009 == b.first - 0.009)
		return a.first > b.first;
	return 0;
}

int main() {
	file();
	int n, t1, t2, k, a, b;
	pair<double, int> ar[1001];
	in(n), in(t1), in(t2), in(k);
	for (int i = 0; i < (int) n and in(a) and in(b); ++i)
		ar[i].first = max((a * t1 * (1.0 - k / 100.0)) + (b * t2),
				(a * t2) + (b * t1 * (1.0 - k / 100.0))), ar[i].second = i + 1;
	sort(ar, ar + (int) n, cmp);
	for (int i = 0; i < n; ++i)
		printf("%d %.2lf\n", ar[i].second, ar[i].first);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
}
bool in(int &x) {
//	return scanf("%lf", &x);		// double
	return scanf("%d", &x);			// int
//	return scanf("%lld", &x);			// long long int
}
void ot(int x) {
	printf("%d ", x);
//	printf("%lld ", x);		//  	long long int
//	printf("%.3lf ", x);
}
#define pb push_back
#define mem(a,b) memset(a,b,sizeof(a))
const int N = 1e3 + 5;
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<int, int> ii;

bool cmp(pair<double, int> b, pair<double, int> a) {
	if (a.first < b.first)
		return 1;
	else if (a.first == b.first)
		return a.first > b.first;
	return 0;
}

int main() {
	file();
	int n, t1, t2, k, a, b, cnt = 0;
	vector<pair<double, int>> ar;
//	in(n), in(t1), in(t2), in(k);
	cin >> n >> t1 >> t2 >> k;
	double per = (double) (100 - k) / 100.0;
	for (int i = 0; i < n; ++i) {
		in(a), in(b);
		ar.pb( { max((a * t1 * per) + (b * t2), (a * t2) + (b * t1 * per)),
				++cnt });
	}
	sort(ar.begin(), ar.end(), cmp);
	for (int i = 0; i < (int) ar.size(); ++i)
		cout << ar[i].second << " " << fixed << setprecision(2) << ar[i].first
				<< endl;
//		printf("%d %.2lf\n", ar[i].second, ar[i].first);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
}
bool in(int &x) {
//	return scanf("%lf", &x);		// double
	return scanf("%d", &x);			// int
//	return scanf("%lld", &x);			// long long int
}
void ot(int x) {
	printf("%d ", x);
//	printf("%lld ", x);		//  	long long int
//	printf("%.3lf ", x);
}
#define pb push_back
#define mem(a,b) memset(a,b,sizeof(a))
const int N = 1e3 + 5;
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<int, int> ii;

bool cmp(pair<double, int> b, pair<double, int> a) {
	if (a.first - 0.009 < b.first - 0.009)
		return 1;
	else if (a.first - 0.009 == b.first - 0.009)
		return a.first > b.first;
	return 0;
}

int main() {
	file();
	int n, t1, t2, k, a, b;
	vector<pair<double, int>> ar;
	in(n), in(t1), in(t2), in(k);
	double per = (double) (100 - k) / 100.0;
	for (int i = 0; i < n and in(a) and in(b); ++i)
		ar.pb(
				{ max((a * t1 * per) + (b * t2), (a * t2) + (b * t1 * per)), i
						+ 1 });
	sort(ar.begin(), ar.end(), cmp);
	for (int i = 0; i < (int) ar.size(); ++i)
		printf("%d %.2lf\n", ar[i].second, ar[i].first);
	return 0;
}


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

#define loop(i,n) for(int lc=i;lc<=n;lc++)
#define tloop(tn) for(int tlc=1;tlc<=tn;tlc++)
#define loop2(i2,n2) for(int lc2=i2;lc2<=n2;lc2++)
#define bloop(n,bn) for(int blc=n;blc>=bn;blc--)
#define il() while(true)
#define pi acos(-1)
#define rad_to_deg(angl) ((180*angl)/pi)
#define ll long long
#define caseno printf("Case %d: ",tlc);

#define sfi(def_var) scanf("%d",&def_var)
#define sfii(def_var,def_var2) scanf("%d %d",&def_var,&def_var2)
#define sfl(def_var) scanf("%lld",&def_var)
#define sfd(def_var) scanf("%lf",&def_var)
#define sfs(def_var) scanf("%s",&def_var)

#define pfi(def_var) printf("%d",def_var)
#define pfl(def_var) printf("%lld",def_var)
#define pfd(def_var) printf("%lf",def_var)
#define pfs(def_var) printf("%s",def_var)
#define pfsn(def_var) printf("%s\n",def_var)

int main()
{
    double n,t1,t2,k;
    cin >> n >> t1 >> t2 >> k;
    k/=100;
    vector< pair<double,int> > v;

    for(int i=0;i<n;i++)
    {
        double a,b;
        cin >> a >> b;
        if(a<b)
        {
            double mashroom=(a*t1)-(a*t1)*k+(b*t2);
            v.push_back( make_pair(mashroom,i) );
        }
        else
        {
            double mashroom=(b*t1)-(b*t1)*k+(a*t2);
            v.push_back( make_pair(mashroom,i+1) );
        }
    }
    sort(v.begin(),v.begin()+n);
    for(int i=n-1;i>=0;i--)
    {
        cout << v[i].second << ' ';
        cout  << fixed << setprecision(2)<< v[i].first << endl;
    }

}


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

#define loop(i,n) for(int lc=i;lc<=n;lc++)
#define tloop(tn) for(int tlc=1;tlc<=tn;tlc++)
#define loop2(i2,n2) for(int lc2=i2;lc2<=n2;lc2++)
#define bloop(n,bn) for(int blc=n;blc>=bn;blc--)
#define il() while(true)
#define pi acos(-1)
#define rad_to_deg(angl) ((180*angl)/pi)
#define ll long long
#define caseno printf("Case %d: ",tlc);

#define sfi(def_var) scanf("%d",&def_var)
#define sfii(def_var,def_var2) scanf("%d %d",&def_var,&def_var2)
#define sfl(def_var) scanf("%lld",&def_var)
#define sfd(def_var) scanf("%lf",&def_var)
#define sfs(def_var) scanf("%s",&def_var)

#define pfi(def_var) printf("%d",def_var)
#define pfl(def_var) printf("%lld",def_var)
#define pfd(def_var) printf("%lf",def_var)
#define pfs(def_var) printf("%s",def_var)
#define pfsn(def_var) printf("%s\n",def_var)

int main()
{
    double n,t1,t2,k;
    cin >> n >> t1 >> t2 >> k;
    k/=100;
    vector< pair<double,int> > v;

    for(int i=0;i<n;i++)
    {
        double a,b;
        cin >> a >> b;
        if(a<b)
        {
            double mashroom=(a*t1)-(a*t1)*k+(b*t2);
            v.push_back( make_pair(mashroom,i+1) );
        }
        else
        {
            double mashroom=(b*t1)-(b*t1)*k+(a*t2);
            v.push_back( make_pair(mashroom,i+1) );
        }
    }
    sort(v.begin(),v.begin()+n);
    for(int i=n-1;i>=0;i--)
    {
        cout << v[i].second << ' ';
        cout  << fixed << setprecision(2)<< v[i].first << endl;
    }

}


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

#define loop(i,n) for(int lc=i;lc<=n;lc++)
#define tloop(tn) for(int tlc=1;tlc<=tn;tlc++)
#define loop2(i2,n2) for(int lc2=i2;lc2<=n2;lc2++)
#define bloop(n,bn) for(int blc=n;blc>=bn;blc--)
#define il() while(true)
#define pi acos(-1)
#define rad_to_deg(angl) ((180*angl)/pi)
#define ll long long
#define caseno printf("Case %d: ",tlc);

#define sfi(def_var) scanf("%d",&def_var)
#define sfii(def_var,def_var2) scanf("%d %d",&def_var,&def_var2)
#define sfl(def_var) scanf("%lld",&def_var)
#define sfd(def_var) scanf("%lf",&def_var)
#define sfs(def_var) scanf("%s",&def_var)

#define pfi(def_var) printf("%d",def_var)
#define pfl(def_var) printf("%lld",def_var)
#define pfd(def_var) printf("%lf",def_var)
#define pfs(def_var) printf("%s",def_var)
#define pfsn(def_var) printf("%s\n",def_var)

int main()
{
    double n,t1,t2,k;
    cin >> n >> t1 >> t2 >> k;
    k/=100;
    vector< pair<double,int> > v;

    for(int i=0;i<n;i++)
    {
        double a,b;
        cin >> a >> b;
        if(a<b)
        {
            double mashroom=(a*t1)-(a*t1)*k+(b*t2);
            v.push_back( make_pair(mashroom,-(i+1)) );
        }
        else
        {
            double mashroom=(b*t1)-(b*t1)*k+(a*t2);
            v.push_back( make_pair(mashroom,-(i+1) ) );
        }
    }
    sort(v.begin(),v.begin()+n);
    for(int i=n-1;i>=0;i--)
    {
        cout << -v[i].second << ' ';
        cout  << fixed << setprecision(2)<< v[i].first << endl;
    }

}


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

#define loop(i,n) for(int lc=i;lc<=n;lc++)
#define tloop(tn) for(int tlc=1;tlc<=tn;tlc++)
#define loop2(i2,n2) for(int lc2=i2;lc2<=n2;lc2++)
#define bloop(n,bn) for(int blc=n;blc>=bn;blc--)
#define il() while(true)
#define pi acos(-1)
#define rad_to_deg(angl) ((180*angl)/pi)
#define ll long long
#define caseno printf("Case %d: ",tlc);

#define sfi(def_var) scanf("%d",&def_var)
#define sfii(def_var,def_var2) scanf("%d %d",&def_var,&def_var2)
#define sfl(def_var) scanf("%lld",&def_var)
#define sfd(def_var) scanf("%lf",&def_var)
#define sfs(def_var) scanf("%s",&def_var)

#define pfi(def_var) printf("%d",def_var)
#define pfl(def_var) printf("%lld",def_var)
#define pfd(def_var) printf("%lf",def_var)
#define pfs(def_var) printf("%s",def_var)
#define pfsn(def_var) printf("%s\n",def_var)

int main()
{
    double n,t1,t2,k;
    cin >> n >> t1 >> t2 >> k;
    k/=100;
    vector< pair<double,int> > v;

    for(int i=0;i<n;i++)
    {
        double a,b;
        cin >> a >> b;
        if(a<b)
        {
            double mashroom=(a*t1)-(a*t1)*k+(b*t2);
            v.push_back( make_pair(mashroom,i+1) );
        }
        else
        {
            double mashroom=(b*t1)-(b*t1)*k+(a*t2);
            v.push_back( make_pair(mashroom,i+1) );
        }
    }
    int i, j, min_idx;

    // One by one move boundary of unsorted subarray
    for (i = 0; i < n-1; i++)
    {
        // Find the minimum element in unsorted array
        min_idx = i;
        for (j = i+1; j < n; j++)
        {

            if(v[j].first - v[min_idx].first > 0.02)
            {
                min_idx = j;
            }
            else if(v[j].second<v[min_idx].second)
            {
                min_idx=j;
            }
        }
        // Swap the found minimum element with the first element
        swap(v[min_idx], v[i]);
    }
    for(int i=0;i<n;i++)
    {
        cout << v[i].second << ' ';
        cout  << fixed << setprecision(2)<< v[i].first << endl;
    }

}


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

#define loop(i,n) for(int lc=i;lc<=n;lc++)
#define tloop(tn) for(int tlc=1;tlc<=tn;tlc++)
#define loop2(i2,n2) for(int lc2=i2;lc2<=n2;lc2++)
#define bloop(n,bn) for(int blc=n;blc>=bn;blc--)
#define il() while(true)
#define pi acos(-1)
#define rad_to_deg(angl) ((180*angl)/pi)
#define ll long long
#define caseno printf("Case %d: ",tlc);

#define sfi(def_var) scanf("%d",&def_var)
#define sfii(def_var,def_var2) scanf("%d %d",&def_var,&def_var2)
#define sfl(def_var) scanf("%lld",&def_var)
#define sfd(def_var) scanf("%lf",&def_var)
#define sfs(def_var) scanf("%s",&def_var)

#define pfi(def_var) printf("%d",def_var)
#define pfl(def_var) printf("%lld",def_var)
#define pfd(def_var) printf("%lf",def_var)
#define pfs(def_var) printf("%s",def_var)
#define pfsn(def_var) printf("%s\n",def_var)

int main()
{
    double n,t1,t2,k;
    cin >> n >> t1 >> t2 >> k;
    k/=100;
    vector< pair<double,int> > v;

    for(int i=0;i<n;i++)
    {
        double a,b;
        cin >> a >> b;
        double mashroom_ab=(a*t1)-(a*t1)*k+(b*t2);
        double mashroom_ba=(b*t1)-(b*t1)*k+(a*t2);
        v.push_back( make_pair( max(mashroom_ab,mashroom_ba),-(i+1) ) );

    }
    sort(v.begin(),v.begin()+n);
    for(int i=n-1;i>=0;i--)
    {
        cout << -v[i].second << ' ';
        cout  << fixed << setprecision(2)<< v[i].first << endl;
    }

}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

bool compare(const pair<int, double> &x , const pair<int, double> &y){
    return x.second > y.second;
}

void solve() {
    int n ;
    double t1 , t2 , k;
    cin>>n>>t1>>t2>>k;
    vector<pair<int, double>> h(n);
    for (int i = 0; i < n; ++i) {
        double v1 , v2;
        cin>>v1>>v2;
        h[i].first = i + 1;
        h[i].second  = max(v1 * t1 - (k * (v1 * t1) / (double)100) + v2 * t2 , v2 * t1 - (k * (v2 * t1) /(double)100) + v1 * t2 );
    }
    stable_sort(h.begin() , h.end() , compare);
    for(int i = 0 ; i < n ; i++){
        printf("%d %0.2lf\n" , h[i].first , h[i].second);
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

bool compare(const pair<int, double> &x , const pair<int, double> &y){
    return x.second > y.second;
}

void solve() {
    int n ;
    double t1 , t2 , k;
    cin>>n>>t1>>t2>>k;
    vector<pair<int, double>> h(n);
    for (int i = 0; i < n; ++i) {
        double v1 , v2;
        cin>>v1>>v2;
        h[i].first = i + 1;
        h[i].second  = max(v1 * t1 - (k * (v1 * t1) / 100) + v2 * t2 , v2 * t1 - (k * (v2 * t1) / 100) + v1 * t2 );
    }
    stable_sort(h.begin() , h.end() , compare);
    for(auto i : h){
        printf("%d %0.2f\n", i.first , i.second);
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

bool compare(const pair<int, double> &x , const pair<int, double> &y){
    return x.second > y.second;
}

void solve() {
    int n ;
    double t1 , t2 , k;
    cin>>n>>t1>>t2>>k;
    vector<pair<int, double>> h(n);
    for (int i = 0; i < n; ++i) {
        double v1 , v2;
        cin>>v1>>v2;
        h[i].first = i + 1;
        h[i].second  = max(v1 * t1 - (k * (v1 * t1) / (double)100) + v2 * t2 , v2 * t1 - (k * (v2 * t1) /(double)100) + v1 * t2 );
    }
    stable_sort(h.begin() , h.end() , compare);
    for(int i = 0 ; i < n ; i++){
        cout<<h[i].first<<" "<<h[i].second<<endl;
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

bool compare(const pair<int, double> &x , const pair<int, double> &y){
    return x.second > y.second;
}

void solve() {
    int n ;
    double t1 , t2 , k;
    cin>>n>>t1>>t2>>k;
    vector<pair<int, double>> h(n);
    for (int i = 0; i < n; ++i) {
        double v1 , v2;
        cin>>v1>>v2;
        h[i].first = i + 1;
        h[i].second  = max(v1 * t1 - (k * (v1 * t1) / (double)100) + v2 * t2 , v2 * t1 - (k * (v2 * t1) /(double)100) + v1 * t2 );
    }
    stable_sort(h.begin() , h.end() , compare);
    cout<<setprecision(2)<<fixed;
    for(int i = 0 ; i < n ; i++){
        cout<<h[i].first<<" "<<h[i].second<<endl;
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

bool compare(const pair<int, double> &x , const pair<int, double> &y){
    return x.second > y.second;
}

void solve() {
    int n ;
    double t1 , t2 , k;
    cin>>n>>t1>>t2>>k;
    vector<pair<int, double>> h(n);
    for (int i = 0; i < n; ++i) {
        double v1 , v2;
        cin>>v1>>v2;
        h[i].first = i + 1;
        h[i].second  = max(v1 * t1 - (k * (v1 * t1) / (double)100) + v2 * t2 , v2 * t1 - (k * (v2 * t1) /(double)100) + v1 * t2 );
    }
    stable_sort(h.begin() , h.end() , compare);
    for(auto i : h){
        printf("%d %0.2lf\n", i.first , i.second);
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

bool compare(const pair<int, double> &x , const pair<int, double> &y){
    return x.second > y.second;
}

void solve() {
    int n ;
    double t1 , t2 , k;
    cin>>n>>t1>>t2>>k;
    vector<pair<int, double>> h(n);
    for (int i = 0; i < n; ++i) {
        double v1 , v2;
        cin>>v1>>v2;
        h[i].first = i + 1;
        h[i].second  = max(v1 * t1 - (k * (v1 * t1) / (double)100) + v2 * t2 , v2 * t1 - (k * (v2 * t1) /(double)100) + v1 * t2 );
    }
    stable_sort(h.begin() , h.end() , compare);
    for(auto i : h){
        printf("%d %0.5f\n", i.first , i.second);
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

bool compare(const pair<int, double> &x , const pair<int, double> &y){
    return x.second > y.second;
}

void solve() {
    int n ;
    double t1 , t2 , k;
    cin>>n>>t1>>t2>>k;
    vector<pair<int, double>> h(n);
    for (int i = 0; i < n; ++i) {
        double v1 , v2;
        cin>>v1>>v2;
        h[i].first = i + 1;
        h[i].second  = max(v1 * t1 - (k * (v1 * t1) / 100) + v2 * t2 , v2 * t1 - (k * (v2 * t1) / 100) + v1 * t2 );
    }
    stable_sort(h.begin() , h.end() , compare);
    for(auto i : h){
        printf("%d %0.2lf\n", i.first , i.second);
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}


#include<iostream>
#include <vector>
#include<algorithm>
#include <iomanip>

using namespace std;
bool sortbyesc(const pair<long long,long long>&a, const pair<long long, long long>& b) {
	if (a.second > b.second)return true;
	else if (a.second == b.second) {
		return a.first < b.first;
	}
	else return false;

}
int main() {
	long long n, t1, t2;  double k;
	cin >> n >> t1 >> t2 >> k;
	vector<pair<long long,  double>>v(n);
	for (int i = 0; i < n; i++) {
		long long  x,y;
		v[i].first = i+1;
		cin >> x >> y;
		auto o1 = (t1 * x) - double(t1 * x * k / 100) + double(t2 * y);
		auto o2 = t1 * y - double(t1 * y * k / 100) + double(t2 * x);
		v[i].second = (o1 > o2) ? o1 : o2;

	}
	sort(v.begin(), v.end(), sortbyesc);
	for (auto& i : v) {
		cout << i.first << " " <<fixed << std::setprecision(2) << i.second << "\n";
	}

}


#include<iostream>
#include <vector>
#include<algorithm>
#include <iomanip>

using namespace std;

int main() {
	long long n, t1, t2;  double k;
	cin >> n >> t1 >> t2 >> k;
	vector<pair<  double ,long long >>v(n);
	for (int i = 0; i < n; i++) {
		long long  x,y;
		v[i].second = i+1;
		cin >> x >> y;
		auto o1 = (t1 * x) - double((t1 * x * k) / 100) + (t2 * y);
		auto o2 = t1 * y - double((t1 * y * k) / 100) + (t2 * x);
		v[i].first = -1*((o1 > o2) ? o1 : o2);

	}
	sort(v.begin(), v.end());
	for (auto& i : v) {
		cout << i.second << " " <<fixed << std::setprecision(2) << -1*i.first << "\n";
	}

}


#include<iostream>
#include <vector>
#include<algorithm>
#include <iomanip>

using namespace std;
bool sortbyesc(const pair<long long,long long>&a, const pair<long long, long long>& b) {
	if (a.second > b.second)return true;
	else if (a.second == b.second) {
		return a.first < b.first;
	}
	else return false;

}
int main() {
	long long n, t1, t2;  double k;
	cin >> n >> t1 >> t2 >> k;
	vector<pair<long long,  double>>v(n);
	for (int i = 0; i < n; i++) {
		long long  x,y;
		v[i].first = i+1;
		cin >> x >> y;
		auto o1 = (t1 * x) - double((t1 * x * k) / 100) + (t2 * y);
		auto o2 = t1 * y - double((t1 * y * k) / 100) + (t2 * x);
		v[i].second = (o1 > o2) ? o1 : o2;

	}
	sort(v.begin(), v.end(), sortbyesc);
	for (auto& i : v) {
		cout << i.first << " " <<fixed << std::setprecision(2) << i.second << "\n";
	}

}


#include<iostream>
#include <vector>
#include<algorithm>
#include <boost/lexical_cast.hpp>

using namespace std;
bool sortbyesc(const pair<long long,long long>&a, const pair<long long, long long>& b) {
	if (a.second > b.second)return true;
	else if (a.second == b.second) {
		return a.first < b.first;
	}
	else return false;

}
int main() {
	long long n, t1, t2,  k;
	cin >> n >> t1 >> t2 >> k;
	vector<pair<long long,  double>>v(n);
	for (int i = 0; i < n; i++) {
		double x,y;
		v[i].first = i+1;
		cin >> x >> y;
		v[i].second = max(   double(t1 * x * double(double(k) / 100))  + double(t2 * y),
			                 double(t1 * y * double(double(k) / 100)) + double(t2 * x));

	}
	sort(v.begin(), v.end(), sortbyesc);
	for (auto& i : v) {
		cout << i.first << " " << lexical_cast<string>(i.second) << "\n";
	}

}


#include <bits/stdc++.h>
#define db(x) cout<<x<<" "
#define db1(x) cout<<x<<'\n'
#define db2(x,y) cout<<x<<" "<<y<<'\n'
#define db3(x,y,z) cout<<x<<" "<<y<<" "<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pair(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define ff first
#define ss second
#define mod 1000000007
using namespace std;
using ll = long long int;
int X[] = {1,0,-1,0};
int Y[] = {0,1,0,-1};
//char mat[101][101];

// int *dp = new int[1000001];
// vector<int>primes;

// void sieve(){

//     for(int i=0;i<1000001;i++)
//     dp[i]=true;

//     dp[1]=false;

//     for(int i=2;i*i<=1000000;i++){

//         if(dp[i]){
//             for(int j=i*i;j<=1000000;j+=i){
//                 dp[j]=false;
//             }
//         }

//     }

//   for(int i=2;i<=1000000;i++)
//   if(dp[i])
//   primes.push_back(i);

// }

// bool isValid(int x,int y,int n,int m) {
//     return (x>=0 && y>=0 && x<n && y<m);
// }

// int dfs(int r,int c, bool *vis,char par, int n, int m) {

//     int ans = 0;

//     for(int i=0;i<4;i++) {
//         int x = X[i]+r;
//         int y = Y[i]+c;

//         bool valid = isValid(x,y,n,m);

//         if(valid == false)
//         continue;

//         if(mat[x][y]!=par && mat[x][y]!='.' && !vis[mat[x][y]-'A']) {
//             vis[mat[x][y]-'A']=true;
//             // db(x);
//             // db(y);
//             ans+=1;
//             //db1(ans);
//         }

//     }

//     return ans;

// }

class cmp {
    public :
    bool operator()(pair<double,int> p1,pair<double,int> p2) {
        if(p1.first!=p2.first)
        return p1.first>p2.first;
        else
        return p1.second<p2.second;
    }
};

double get(ll v1, ll v2, ll t1, ll t2, ll k) {

    if(v1*t1>v2*t2){
        ll temp = v1;
        v1=v2;
        v2=temp;
    }

    double h1 = v1*t1;
    double K = k/(100*1.0);
    h1-=(h1*K);

    double h2 = v2*t2;

    return h1+h2;

}

void solve(){

   ll n,t1,t2,k;
   cin>>n>>t1>>t2>>k;

   vector<pair<double,int>> v;

  rep(i,n) {
      ll u1,u2;
      cin>>u1>>u2;
     double h = get(u1,u2,t1,t2,k);
     v.push_back(make_pair(h,i+1));
  }

   sort(v.begin(),v.end(),cmp());

   rep(i,v.size()) {
       cout<<fixed<<setprecision(2)<<v[i].second<<" ";
       db1(v[i].first);
   }

}

int main(){

 int t=1;
 //cin>>t;

while(t--){
 solve();
  }

    //   ll p = binary_search((ll)4,(ll)-2,(ll)5);

    //   db1(p);

  return 0;
}


#include <bits/stdc++.h>
#define db(x) cout<<x<<" "
#define db1(x) cout<<x<<'\n'
#define db2(x,y) cout<<x<<" "<<y<<'\n'
#define db3(x,y,z) cout<<x<<" "<<y<<" "<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pair(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define ff first
#define ss second
#define mod 1000000007
using namespace std;
using ll = long long int;
int X[] = {1,0,-1,0};
int Y[] = {0,1,0,-1};
//char mat[101][101];

// int *dp = new int[1000001];
// vector<int>primes;

// void sieve(){

//     for(int i=0;i<1000001;i++)
//     dp[i]=true;

//     dp[1]=false;

//     for(int i=2;i*i<=1000000;i++){

//         if(dp[i]){
//             for(int j=i*i;j<=1000000;j+=i){
//                 dp[j]=false;
//             }
//         }

//     }

//   for(int i=2;i<=1000000;i++)
//   if(dp[i])
//   primes.push_back(i);

// }

// bool isValid(int x,int y,int n,int m) {
//     return (x>=0 && y>=0 && x<n && y<m);
// }

// int dfs(int r,int c, bool *vis,char par, int n, int m) {

//     int ans = 0;

//     for(int i=0;i<4;i++) {
//         int x = X[i]+r;
//         int y = Y[i]+c;

//         bool valid = isValid(x,y,n,m);

//         if(valid == false)
//         continue;

//         if(mat[x][y]!=par && mat[x][y]!='.' && !vis[mat[x][y]-'A']) {
//             vis[mat[x][y]-'A']=true;
//             // db(x);
//             // db(y);
//             ans+=1;
//             //db1(ans);
//         }

//     }

//     return ans;

// }

class cmp {
    public :
    bool operator()(pair<double,int> p1,pair<double,int> p2) {
        if(p1.first!=p2.first)
        return p1.first>p2.first;
        else
        return p1.second<p2.second;
    }
};

double get(ll v1, ll v2, ll t1, ll t2, ll k) {

    if(v1>v2){
        ll temp = v1;
        v1=v2;
        v2=temp;
    }

    double h1 = v1*t1;
    double K = k/(100*1.0);
    h1-=(h1*K);

    double h2 = v2*t2;

    return h1+h2;

}

void solve(){

   ll n,t1,t2,k;
   cin>>n>>t1>>t2>>k;

   vector<pair<double,int>> v;

  rep(i,n) {
      ll u1,u2;
      cin>>u1>>u2;
     double h = get(u1,u2,t1,t2,k);
     v.push_back(make_pair(h,i+1));
  }

   sort(v.begin(),v.end(),cmp());

   rep(i,v.size()) {
       cout<<fixed<<setprecision(2)<<v[i].second<<" ";
       db1(v[i].first);
   }

}

int main(){

 int t=1;
 //cin>>t;

while(t--){
 solve();
  }

    //   ll p = binary_search((ll)4,(ll)-2,(ll)5);

    //   db1(p);

  return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <cassert>
#include <vector>
#include <set>
#include <ctime>
#pragma comment (linker, "/STACK:1000000000")

using namespace std;

list <int> depth[100000];
vector <pair <int, int> > edges;

int k;
void dfs(int u, int deep)
{
    for (int i = 0; i < k; i++)
    {
        if (depth[deep + 1].empty())
            break;
        edges.push_back(make_pair(u, depth[deep + 1].front()));
        dfs(depth[deep + 1].front(), deep + 1);
        depth[deep + 1].pop_front();
    }
}

int main()
{
    int n;
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; i++)
    {
        int x;
        scanf("%d", &x);
        depth[x].push_back(i);
    }
    dfs(depth[0].front(), 0);
    depth[0].pop_front();
    for (int i = 0; i < n; i++)
    if (!depth[i].empty())
    {
        printf("-1");
        return 0;
    }
    printf("%d\n", edges.size());
    for (int i = 0; i < edges.size(); i++)
        printf("%d %d\n", edges[i].first + 1, edges[i].second + 1);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <cassert>
#include <vector>
#include <set>
#include <ctime>
#pragma comment (linker, "/STACK:1000000000")

using namespace std;

list <int> depth[100000];
vector <pair <int, int> > edges;

int k;
void dfs(int u, int deep)
{
    for (int i = 0; i < k - (deep != 0); i++)
    {
        if (depth[deep + 1].empty())
            break;
        edges.push_back(make_pair(u, depth[deep + 1].front()));
        dfs(depth[deep + 1].front(), deep + 1);
        depth[deep + 1].pop_front();
    }
}

int main()
{
    int n;
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; i++)
    {
        int x;
        scanf("%d", &x);
        depth[x].push_back(i);
    }
    dfs(depth[0].front(), 0);
    depth[0].pop_front();
    for (int i = 0; i < n; i++)
    if (!depth[i].empty())
    {
        printf("-1");
        return 0;
    }
    printf("%d\n", edges.size());
    for (int i = 0; i < edges.size(); i++)
        printf("%d %d\n", edges[i].first + 1, edges[i].second + 1);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <cassert>
#include <vector>
#include <set>
#include <ctime>
#pragma comment (linker, "/STACK:1000000000")

using namespace std;

list <int> depth[100000];
vector <pair <int, int> > edges;

int k;
void dfs(int u, int deep)
{
    for (int i = 0; i < k - (deep != 0); i++)
    {
        if (depth[deep + 1].empty())
            break;
        edges.push_back(make_pair(u, depth[deep + 1].front()));
        dfs(depth[deep + 1].front(), deep + 1);
        depth[deep + 1].pop_front();
    }
}

int main()
{
    int n;
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; i++)
    {
        int x;
        scanf("%d", &x);
        depth[x].push_back(i);
    }
    if (depth[0].empty())
    {
        printf("-1");
        return 0;
    }
    dfs(depth[0].front(), 0);
    depth[0].pop_front();
    for (int i = 0; i < n; i++)
        if (!depth[i].empty())
        {
            printf("-1");
            return 0;
        }
    printf("%d\n", edges.size());
    for (int i = 0; i < edges.size(); i++)
        printf("%d %d\n", edges[i].first + 1, edges[i].second + 1);
    return 0;
}


#include<iostream>
#include<vector>
using namespace std;
vector<pair<int,int>> edges;
vector<int> v[1000005];
int main()
{
    long long k,n;
    cin>>n>>k;
    for(int i=0;i<n;++i)
	{
        int d;
        cin>>d;
        v[d].push_back(i);
    }
	if(v[0].size()!=1) { cout<<-1; goto a; }
    for(int i=1;i<n;i++)
	{
        if(v[i].size()>v[i-1].size()*k)
		{  cout<<-1; goto a; }
        for(int j=0;j<v[i].size();j++)
            edges.push_back(make_pair(v[i][j],v[i-1][j/k]));
        if(i==1)  --k;
	}

    cout<<edges.size()<<"\n";
    for(int i=0;i<edges.size();++i)
        cout<<edges[i].first+1<<" "<<edges[i].second+1<<"\n";
	a:return 0;
}


#include<iostream>
#include<vector>
using namespace std;
vector<pair<int,int>> edges;
vector<int> v[1000005];
int main()
{
    long long k,n;
    cin>>n>>k;
    for(int i=0;i<n;++i)
	{
        int d;
        cin>>d;
        v[d].push_back(i);
    }
	if(v[0].size()!=1) {cout<<-1; goto a;}
    for(int i=1;i<n;++i)
	{
        if(v[i].size()>v[i-1].size()*k)
		{cout<<-1; goto a;}
        for(int j=0;j<v[i].size();++j)
            edges.push_back(make_pair(v[i][j],v[i-1][j/k]));
        if(i==1)  --k;
	}
    cout<<edges.size()<<"\n";
    for(int i=0;i<edges.size();++i)
        cout<<edges[i].first+1<<" "<<edges[i].second+1<<"\n";
	a:return 0;
}


#include<iostream>
#include<vector>
using namespace std;
vector<pair<int,int>> edges;
vector<int> v[1000005];
int main()
{
    int k,n;
    cin>>n>>k;
    for(int i=0;i<n;++i)
	{
        int d;
        cin>>d;
        v[d].push_back(i);
    }
	if(v[0].size()!=1) { cout<<-1; goto a; }
    for(int i=1;i<n;i++)
	{
        if(v[i].size()>v[i-1].size()*k)
		{  cout<<-1; goto a; }
        for(int j=0;j<v[i].size();j++)
            edges.push_back(make_pair(v[i][j],v[i-1][j/k]));
        if(i==1)  --k;
	}

    cout<<edges.size()<<"\n";
    for(int i=0;i<edges.size();++i)
        cout<<edges[i].first+1<<" "<<edges[i].second+1<<"\n";
	a:return 0;
}


#include<iostream>
#include<vector>
using namespace std;
vector<pair<int,int>> edges;
vector<int> v[1000005];
int main()
{
    int k,n;
    cin>>n>>k;
    for(int i=0;i<n;++i)
	{
        int d;
        cin>>d;
        v[d].push_back(i);
    }
	if(v[0].size()!=1) { cout<<-1; goto a; }
    for(int i=1;i<n;++i)
	{
        if(v[i].size()>v[i-1].size()*k)
		{  cout<<-1; goto a; }
        for(int j=0;j<v[i].size();++j)
            edges.push_back(make_pair(v[i][j],v[i-1][j/k]));
        if(i==1)  --k;
	}

    cout<<edges.size()<<"\n";
    for(int i=0;i<edges.size();++i)
        cout<<edges[i].first+1<<" "<<edges[i].second+1<<"\n";
	a:return 0;
}


#include<iostream>
#include<vector>
using namespace std;
vector<pair<int,int>> edges;
vector<int> v[1000005];
int main()
{
    int k,n;
    cin>>n>>k;
    for(int i=0;i<n;++i)
	{
        int d;
        cin>>d;
        v[d].push_back(i);
    }
	if(v[0].size()!=1) { cout<<-1; goto a; }
    for(int i=1;i<n;++i)
	{
        if(v[i].size()>v[i-1].size()*k)
		{  cout<<-1; goto a; }
        for(int j=0;j<v[i].size();++j)
            edges.push_back(make_pair(v[i][j],v[i-1][j/k]));
        if(i==1)  --k;
	}
	a:return 0;
    cout<<edges.size()<<"\n";
    for(int i=0;i<edges.size();++i)
        cout<<edges[i].first+1<<" "<<edges[i].second+1<<"\n";
}


#include<iostream>
#include<vector>
using namespace std;
vector<pair<int,int>> edges;
vector<int> v[1000005];
int main()
{
    int k,n;
    cin>>n>>k;
    for(int i=0;i<n;++i)
	{
        int d;
        cin>>d;
        v[d].push_back(i);
    }
    if(v[0].size()!=1)  cout<<-1;
	else
    for(int i=1;i<n;++i)
	{
        if(v[i].size()>v[i-1].size()*k)
            cout<<-1;
		else
		{
        for(int j=0;j<v[i].size();++j)
            edges.push_back(make_pair(v[i][j],v[i-1][j/k]));
        if(i==1)  --k;
		}
    }
    cout<<edges.size()<<"\n";
    for(int i=0;i<edges.size();++i)
        cout<<edges[i].first+1<<" "<<edges[i].second+1<<"\n";

}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>
#include <functional>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <ctime>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd paur<double, double>
#define fi first
#define se second
#define forn(i,a,b) for( int i = (a); i < (b); i++ )
#define rep(i,n) for( int i = 0; i < (n); i++ )
#define forever for(;;)

const int MXN = 100100;
const ll inf = 1e15;

int sz [MXN];
int p [MXN];
int d [MXN];

vector<int> vv [MXN];
int pnt [MXN];

int main(){
    int n,k;
    scanf("%d%d", &n, &k);

    int mx = 0;
    rep(i,n){
        scanf("%d", &d[i]);
        vv[d[i]].push_back(i);
        mx = max(mx,d[i]);
    }
    if( mx>n || vv[0].size()!=1 ){
        printf("-1");
        return 0;
    }

    forn(i,1,mx+1){
        if( vv[i].empty() ){
            printf("-1");
            return 0;
        }
        int ssz = vv[i].size();
        rep(j,ssz){
            if( sz[vv[i-1][pnt[i-1]]]==k ) pnt[i-1]++;
            if( pnt[i-1]>=vv[i-1].size() ){
                printf("-1");
                return 0;
            }
            p[vv[i][j]] = vv[i-1][pnt[i-1]];
            sz[vv[i][j]] = 1;
            sz[vv[i-1][pnt[i-1]]]++;
        }
    }

    printf("%d\n", n-1);
    rep(i,n){
        if( d[i] ) printf("%d %d\n", i+1, p[i]+1 );
    }
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>
#include <functional>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <ctime>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd paur<double, double>
#define fi first
#define se second
#define forn(i,a,b) for( int i = (a); i < (b); i++ )
#define rep(i,n) for( int i = 0; i < (n); i++ )
#define forever for(;;)

const int MXN = 100100;
const ll inf = 1e15;

int sz [MXN];
int p [MXN];
int d [MXN];

vector<int> vv [MXN];
int pnt [MXN];

int main(){
    int n,k;
    scanf("%d%d", &n, &k);

    int mx = 0;
    rep(i,n){
        scanf("%d", &d[i]);
        vv[d[i]].push_back(i);
        mx = max(mx,d[i]);
    }
    if( mx>n || vv[0].size()!=1 ){
        printf("-1");
        return 0;
    }

    forn(i,1,mx){
        if( vv[i].empty() ){
            printf("-1");
            return 0;
        }
        int ssz = vv[i].size();
        rep(j,ssz){
            if( sz[vv[i-1][pnt[i-1]]]==k ) pnt[i-1]++;
            if( pnt[i-1]>=vv[i-1].size() ){
                printf("-1");
                return 0;
            }
            p[vv[i][j]] = vv[i-1][pnt[i-1]];
        }
    }

    printf("%d\n", n-1);
    rep(i,n){
        if( d[i] ) printf("%d %d\n", i+1, p[i]+1 );
    }
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>
#include <functional>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <ctime>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd paur<double, double>
#define fi first
#define se second
#define forn(i,a,b) for( int i = (a); i < (b); i++ )
#define rep(i,n) for( int i = 0; i < (n); i++ )
#define forever for(;;)

const int MXN = 100100;
const ll inf = 1e15;

int sz [MXN];
int p [MXN];
int d [MXN];

vector<int> vv [MXN];
int pnt [MXN];

int main(){
    int n,k;
    scanf("%d%d", &n, &k);

    int mx = 0;
    rep(i,n){
        scanf("%d", &d[i]);
        vv[d[i]].push_back(i);
        mx = max(mx,d[i]);
    }
    if( mx>n || vv[0].size()!=1 ){
        printf("-1");
        return 0;
    }

    forn(i,1,mx+1){
        if( vv[i].empty() ){
            printf("-1");
            return 0;
        }
        int ssz = vv[i].size();
        rep(j,ssz){
            if( sz[vv[i-1][pnt[i-1]]]==k ) pnt[i-1]++;
            if( pnt[i-1]>=vv[i-1].size() ){
                printf("-1");
                return 0;
            }
            p[vv[i][j]] = vv[i-1][pnt[i-1]];
        }
    }

    printf("%d\n", n-1);
    rep(i,n){
        if( d[i] ) printf("%d %d\n", i+1, p[i]+1 );
    }
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long LL;
int dis[10010];
int first[10010],nxt[10010],vv[10010];

int main()
{
    int n,k;
    scanf("%d%d",&n,&k);

    int e=2;
    int maxL=0;
    for(int i=1;i<=n;i++)
    {
        int d;
        scanf("%d",&d);
        maxL = max(maxL, d);
        dis[d]++;
        nxt[e]=first[d],vv[e]=i,first[d]=e++;
    }

    if(dis[0]!=1 || (n>1 && dis[1]>k))
    {
        puts("-1");
        return 0;
    }

    for(int i=2;i<=maxL;i++)
    {
        if(dis[i]>(k-1)*dis[i-1])
        {
            puts("-1");
            return 0;
        }
    }

    printf("%d\n", n-1);
    for(int ee=first[1];ee;ee=nxt[ee])
    {
        printf("%d %d\n", vv[first[0]], vv[ee]);
    }

    for(int i=2;i<=maxL;i++)
    {
        int aa=first[i-1];
        int num=0;
        for(int bb=first[i];bb;bb=nxt[bb])
        {
            printf("%d %d\n", vv[aa], vv[bb]);
            num++;
            if(num==k-1) num=0,aa=nxt[aa];
        }
    }
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long LL;
int dis[100010];
int first[100010],nxt[100010],vv[100010];

int main()
{
    int n,k;
    scanf("%d%d",&n,&k);

    int e=2;
    int maxL=0;
    for(int i=1;i<=n;i++)
    {
        int d;
        scanf("%d",&d);
        maxL = max(maxL, d);
        dis[d]++;
        nxt[e]=first[d],vv[e]=i,first[d]=e++;
    }

    if(dis[0]!=1 || (n>1 && dis[1]>k))
    {
        puts("-1");
        return 0;
    }

    for(int i=2;i<=maxL;i++)
    {
        if(dis[i]>(k-1)*dis[i-1])
        {
            puts("-1");
            return 0;
        }
    }

    printf("%d\n", n-1);
    for(int ee=first[1];ee;ee=nxt[ee])
    {
        printf("%d %d\n", vv[first[0]], vv[ee]);
    }

    for(int i=2;i<=maxL;i++)
    {
        int aa=first[i-1];
        int num=0;
        for(int bb=first[i];bb;bb=nxt[bb])
        {
            printf("%d %d\n", vv[aa], vv[bb]);
            num++;
            if(num==k-1) num=0,aa=nxt[aa];
        }
    }
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long LL;
int dis[1000010];
int first[1000010],nxt[1000010],vv[1000010];

int main()
{
    int n,k;
    scanf("%d%d",&n,&k);

    int e=2;
    int maxL=0;
    for(int i=1;i<=n;i++)
    {
        int d;
        scanf("%d",&d);
        maxL = max(maxL, d);
        dis[d]++;
        nxt[e]=first[d],vv[e]=i,first[d]=e++;
    }

    if(dis[0]!=1 || (n>1 && dis[1]>k))
    {
        puts("-1");
        return 0;
    }

    for(int i=2;i<=maxL;i++)
    {
        if(dis[i]>(k-1)*dis[i-1])
        {
            puts("-1");
            return 0;
        }
    }

    printf("%d\n", n-1);
    for(int ee=first[1];ee;ee=nxt[ee])
    {
        printf("%d %d\n", vv[first[0]], vv[ee]);
    }

    for(int i=2;i<=maxL;i++)
    {
        int aa=first[i-1];
        int num=0;
        for(int bb=first[i];bb;bb=nxt[bb])
        {
            printf("%d %d\n", vv[aa], vv[bb]);
            num++;
            if(num==k-1) num=0,aa=nxt[aa];
        }
    }
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long LL;
int dis[1000010];
int first[1000010],nxt[1000010],vv[1000010];

int main()
{
    int n,k;
    scanf("%d%d",&n,&k);

    int e=2;
    int maxL=0;
    for(int i=1;i<=n;i++)
    {
        int d;
        scanf("%d",&d);
        maxL = max(maxL, d);
        dis[d]++;
        nxt[e]=first[d],vv[e]=i,first[d]=e++;
    }

    if(dis[0]!=1 || (n>1 && dis[1]>k))
    {
        puts("-1");
        return 0;
    }

    for(int i=2;i<=maxL;i++)
    {
        if(dis[i]>(long long)(k-1)*dis[i-1])
        {
            puts("-1");
            return 0;
        }
    }

    printf("%d\n", n-1);
    for(int ee=first[1];ee;ee=nxt[ee])
    {
        printf("%d %d\n", vv[first[0]], vv[ee]);
    }

    for(int i=2;i<=maxL;i++)
    {
        int aa=first[i-1];
        int num=0;
        for(int bb=first[i];bb;bb=nxt[bb])
        {
            printf("%d %d\n", vv[aa], vv[bb]);
            num++;
            if(num==k-1) num=0,aa=nxt[aa];
        }
    }
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<fstream>
#include<algorithm>
#include<sstream>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<list>
#include<vector>
#include<utility>
#include<stack>
#include<iterator>
#include<deque>
#include<iomanip>
using namespace std;
//
typedef long long LL;
typedef unsigned int UINT;
#define FOR(i,s,t) for(i=(s);i<(t);i++)
#define MEMSET(x,y) memset(x,y,sizeof(x))
const int MAXN=INT_MAX;
const int INF=1000000007;
const int MINN=INT_MIN;
struct node
{
    int i,d;
    bool operator<(const node &a)const{return d<a.d;}
}p[100005];
int d[100005];
vector<int>edge[100005];
int main()
{
    //
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt","w",stdout);
#endif
    //
    int i,j,k,r,x,y,z,n,flag,l,t;
    int I,J,K,M,N,A,B,X,Y,L,R,T,P,G;
    //string s;
    scanf("%d%d",&n,&k);
    FOR(i,0,n){
        scanf("%d",&p[i].d);
        p[i].i=i+1;
        d[p[i].d]++;
        edge[p[i].d].push_back(i+1);
    }
    sort(p,p+n);
    l=p[n-1].d;
    //(k-1)*d[i]<d[i+1],break;
    for(i=1;i<l&&d[i];i++){
        if(d[i+1]/d[i]>k-1)break;
    }
    if(d[0]!=1||i!=l){
        puts("-1");
        return 0;
    }
    printf("%d\n",n-1);
    for(i=1;i<=l;i++){
        t=d[i]/d[i-1];
        for(j=y=L=0;j<=t&&y<d[i];j++,L++){
            for(z=0;((i==1&&z<k)||z<k-1)&&y<d[i];z++,y++){
                printf("%d %d\n",edge[i-1][L],edge[i][y]);
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<fstream>
#include<algorithm>
#include<sstream>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<list>
#include<vector>
#include<utility>
#include<stack>
#include<iterator>
#include<deque>
#include<iomanip>
using namespace std;
//
typedef long long LL;
typedef unsigned int UINT;
#define FOR(i,s,t) for(i=(s);i<(t);i++)
#define MEMSET(x,y) memset(x,y,sizeof(x))
const int MAXN=INT_MAX;
const int INF=1000000007;
const int MINN=INT_MIN;
struct node
{
    int i,d;
    bool operator<(const node &a)const{return d<a.d;}
}p[100005];
int d[100005];
vector<int>edge[100005];
int main()
{
    //
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt","w",stdout);
#endif
    //
    int i,j,k,r,x,y,z,n,flag,l,t;
    int I,J,K,M,N,A,B,X,Y,L,R,T,P,G;
    //string s;
    scanf("%d%d",&n,&k);
    FOR(i,0,n){
        scanf("%d",&p[i].d);
        p[i].i=i+1;
        d[p[i].d]++;
        edge[p[i].d].push_back(i+1);
    }
    sort(p,p+n);
    l=p[n-1].d;
    //(k-1)*d[i]<d[i+1],break;
    for(i=1;i<l&&d[i];i++){
        if(d[i+1]/d[i]>k-1)break;
    }
    if(d[0]!=1||i!=l){
        puts("-1");
        return 0;
    }
    printf("%d\n",n-1);
    for(i=1;i<=l;i++){
        for(j=y=0;y<d[i];j++){
            if(i==1)z=-1;
            else z=0;
            for(;(z<k-1)&&y<d[i];z++,y++){
                printf("%d %d\n",edge[i-1][j],edge[i][y]);
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<fstream>
#include<algorithm>
#include<sstream>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<list>
#include<vector>
#include<utility>
#include<stack>
#include<iterator>
#include<deque>
#include<iomanip>
using namespace std;
//
typedef long long LL;
typedef unsigned int UINT;
#define FOR(i,s,t) for(i=(s);i<(t);i++)
#define MEMSET(x,y) memset(x,y,sizeof(x))
const int MAXN=INT_MAX;
const int INF=1000000007;
const int MINN=INT_MIN;
struct node
{
    int i,d;
    bool operator<(const node &a)const{return d<a.d;}
}p[100005];
int d[100005];
vector<int>edge[100005];
int main()
{
    //
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt","w",stdout);
#endif
    //
    int i,j,k,r,x,y,z,n,flag,l,t;
    int I,J,K,M,N,A,B,X,Y,L,R,T,P,G;
    //string s;
    scanf("%d%d",&n,&k);
    FOR(i,0,n){
        scanf("%d",&p[i].d);
        p[i].i=i+1;
        d[p[i].d]++;
        edge[p[i].d].push_back(i+1);
    }
    sort(p,p+n);
    l=p[n-1].d;
    for(i=1;i<l&&d[i];i++){
        if(d[i+1]/d[i]>k)break;
    }
    if(d[0]!=1||i!=l){
        puts("-1");
        return 0;
    }
    printf("%d\n",n-1);
    for(i=1;i<=l;i++){
        t=d[i]/d[i-1];
        for(j=y=L=R=0;j<=t&&y<d[i];j++,L++){
            for(z=0;((i==1&&z<k)||z<k-1)&&y<d[i];z++,y++,R++){
                printf("%d %d\n",edge[i-1][L],edge[i][R]);
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<fstream>
#include<algorithm>
#include<sstream>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<list>
#include<vector>
#include<utility>
#include<stack>
#include<iterator>
#include<deque>
#include<iomanip>
using namespace std;
//
typedef long long LL;
typedef unsigned int UINT;
#define FOR(i,s,t) for(i=(s);i<(t);i++)
#define MEMSET(x,y) memset(x,y,sizeof(x))
const int MAXN=INT_MAX;
const int INF=1000000007;
const int MINN=INT_MIN;
struct node
{
    int i,d;
    bool operator<(const node &a)const{return d<a.d;}
}p[100005];
int d[100005];
vector<int>edge[100005];
int main()
{
    //
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt","w",stdout);
#endif
    //
    int i,j,k,r,x,y,z,n,flag,l,t;
    int I,J,K,M,N,A,B,X,Y,L,R,T,P,G;
    //string s;
    scanf("%d%d",&n,&k);
    FOR(i,0,n){
        scanf("%d",&p[i].d);
        p[i].i=i+1;
        d[p[i].d]++;
        edge[p[i].d].push_back(i+1);
    }
    sort(p,p+n);
    l=p[n-1].d;
    for(i=1;i<l&&d[i];i++){
        if(d[i+1]/d[i]>k)break;
    }
    if(d[0]!=1||i!=l){
        puts("-1");
        return 0;
    }
    printf("%d\n",n-1);
    for(i=1;i<=l;i++){
        t=d[i]/d[i-1];
        for(j=y=L=R=0;j<=t&&y<d[i];j++,L++){
            for(z=0;z<k&&y<d[i];z++,y++,R++){
                printf("%d %d\n",edge[i-1][L],edge[i][R]);
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<fstream>
#include<algorithm>
#include<sstream>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<list>
#include<vector>
#include<utility>
#include<stack>
#include<iterator>
#include<deque>
#include<iomanip>
using namespace std;
//
typedef long long LL;
typedef unsigned int UINT;
#define FOR(i,s,t) for(i=(s);i<(t);i++)
#define MEMSET(x,y) memset(x,y,sizeof(x))
const int MAXN=INT_MAX;
const int INF=1000000007;
const int MINN=INT_MIN;
struct node
{
    int i,d;
    bool operator<(const node &a)const{return d<a.d;}
}p[100005];
int d[100005];
vector<int>edge[100005];
int main()
{
    //
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt","w",stdout);
#endif
    //
    int i,j,k,r,x,y,z,n,flag,l,t;
    int I,J,K,M,N,A,B,X,Y,L,R,T,P,G;
    //string s;
    scanf("%d%d",&n,&k);
    FOR(i,0,n){
        scanf("%d",&p[i].d);
        p[i].i=i+1;
        d[p[i].d]++;
        edge[p[i].d].push_back(i+1);
    }
    sort(p,p+n);
    l=p[n-1].d;
    //(k-1)*d[i]<d[i+1],break;
    for(i=1;i<l&&d[i];i++){

        if(d[i+1]/d[i]>k-1)break;
    }
    if(d[0]!=1||i!=l||d[1]>k){
        puts("-1");
        return 0;
    }
    printf("%d\n",n-1);
    for(i=1;i<=l;i++){
        t=d[i]/d[i-1];
        for(j=y=L=R=0;j<=t&&y<d[i];j++,L++){
            for(z=0;((i==1&&z<k)||z<k-1)&&y<d[i];z++,y++,R++){
                printf("%d %d\n",edge[i-1][L],edge[i][R]);
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<fstream>
#include<algorithm>
#include<sstream>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<list>
#include<vector>
#include<utility>
#include<stack>
#include<iterator>
#include<deque>
#include<iomanip>
using namespace std;
//
typedef long long LL;
typedef unsigned int UINT;
#define FOR(i,s,t) for(i=(s);i<(t);i++)
#define MEMSET(x,y) memset(x,y,sizeof(x))
const int MAXN=INT_MAX;
const int INF=1000000007;
const int MINN=INT_MIN;
struct node
{
    int i,d;
    bool operator<(const node &a)const{return d<a.d;}
}p[100005];
int d[100005];
vector<int>edge[100005];
int main()
{
    //
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt","w",stdout);
#endif
    //
    int i,j,k,r,x,y,z,n,flag,l,t;
    int I,J,K,M,N,A,B,X,Y,L,R,T,P,G;
    //string s;
    scanf("%d%d",&n,&k);
    FOR(i,0,n){
        scanf("%d",&p[i].d);
        p[i].i=i+1;
        d[p[i].d]++;
        edge[p[i].d].push_back(i+1);
    }
    sort(p,p+n);
    l=p[n-1].d;
    //(k-1)*d[i]<d[i+1],break;
    for(i=1;i<l&&d[i];i++){
        if(d[i+1]/d[i]>k-1)break;
    }
    if(d[0]!=1||i!=l){
        puts("-1");
        return 0;
    }
    printf("%d\n",n-1);
    for(i=1;i<=l;i++){
        t=d[i]/d[i-1];
        for(j=y=L=R=0;j<t&&y<d[i];j++,L++){
            for(z=0;((i==1&&z<k)||z<k-1)&&y<d[i];z++,y++,R++){
                printf("%d %d\n",edge[i-1][L],edge[i][R]);
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<fstream>
#include<algorithm>
#include<sstream>
#include<string>
#include<cstring>
#include<cmath>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<list>
#include<vector>
#include<utility>
#include<stack>
#include<iterator>
#include<deque>
#include<iomanip>
using namespace std;
//
typedef long long LL;
typedef unsigned int UINT;
#define FOR(i,s,t) for(i=(s);i<(t);i++)
#define MEMSET(x,y) memset(x,y,sizeof(x))
const int MAXN=INT_MAX;
const int INF=1000000007;
const int MINN=INT_MIN;
struct node
{
    int i,d;
    bool operator<(const node &a)const{return d<a.d;}
}p[100005];
int d[100005];
vector<int>edge[100005];
int main()
{
    //
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    //freopen("out.txt","w",stdout);
#endif
    //
    int i,j,k,r,x,y,z,n,flag,l,t;
    int I,J,K,M,N,A,B,X,Y,L,R,T,P,G;
    //string s;
    scanf("%d%d",&n,&k);
    FOR(i,0,n){
        scanf("%d",&p[i].d);
        p[i].i=i+1;
        d[p[i].d]++;
        edge[p[i].d].push_back(i+1);
    }
    sort(p,p+n);
    l=p[n-1].d;
    //(k-1)*d[i]<d[i+1],break;
    for(i=1;i<l&&d[i];i++){
        if(d[i+1]/d[i]>k-1)break;
    }
    if(d[0]!=1||i!=l||d[1]>k){
        puts("-1");
        return 0;
    }
    printf("%d\n",n-1);
    for(i=1;i<=l;i++){
        for(j=y=0;y<d[i];j++){
            if(i==1)z=-1;
            else z=0;
            for(;(z<k-1)&&y<d[i];z++,y++){
                printf("%d %d\n",edge[i-1][j],edge[i][y]);
            }
        }
    }
    return 0;
}


#include <iostream>
#include <memory.h>
using namespace std;

struct node
{
	long number;
	struct node *next;
};

struct link
{
	long a, b;
};

struct node *mas[100000];
long neighbours[100000];
struct link links[100000];

int main()
{
	long n, k;
	cin >> n >> k;
	memset(mas, 0, sizeof(struct node*));
	for (long i = 0; i < n; i++)
	{
		long t;
		cin >> t;
		struct node *p = new struct node;
		p->next = mas[t];
		p->number = i;
		mas[t] = p;
	}
	long size = 0;
	if (mas[0]->next != 0)
	{
		cout << -1;
		return 0;
	}
	memset(neighbours, 0, 100000*sizeof(long));
	for (long i = 1; i < n; i++)
	{
		struct node *p;
		p = mas[i];
		struct node *q;
		q = mas[i-1];
		while (p)
		{
			while ((q) && (neighbours[q->number] >= k))
				q = q->next;
			if (q == 0)
			{
				cout << -1;
				return 0;
			}
			neighbours[p->number]++;
			neighbours[q->number]++;
			links[size].a = p->number;
			links[size++].b = q->number;
			p = p->next;
		}
	}
	cout << size << endl;
	for (long i = 0; i < size; i++)
		cout << links[i].a+1 << ' ' << links[i].b+1 << endl;
	return 0;
}


#include <iostream>
#include <memory.h>
using namespace std;

struct node
{
	long number;
	struct node *next;
};

struct link
{
	long a, b;
};

struct node *mas[100000];
long neighbours[100000];
struct link links[100000];

int main()
{
	long n, k;
	cin >> n >> k;
	memset(mas, 0, sizeof(struct node*));
	for (long i = 0; i < n; i++)
	{
		long t;
		cin >> t;
		struct node *p = new struct node;
		p->next = mas[t];
		p->number = i;
		mas[t] = p;
	}
	long size = 0;
	if (mas[0]->next != 0)
	{
		cout << -1;
		return 0;
	}
	memset(neighbours, 0, 100000*sizeof(long));
	for (long i = 1; i < n; i++)
	{
		struct node *p;
		p = mas[i];
		struct node *q;
		q = mas[i-1];
		while (p)
		{
			while ((q) && (neighbours[q->number] > k))
				q = q->next;
			if (q == 0)
			{
				cout << -1;
				return 0;
			}
			neighbours[p->number]++;
			neighbours[q->number]++;
			links[size].a = p->number;
			links[size++].b = q->number;
			p = p->next;
		}
	}
	cout << size << endl;
	for (long i = 0; i < size; i++)
		cout << links[i].a+1 << ' ' << links[i].b+1 << endl;
	return 0;
}


#include <iostream>
#include <memory.h>
using namespace std;

struct node
{
	long number;
	struct node *next;
};

struct link
{
	long a, b;
};

struct node *mas[100000];
long neighbours[100000];
struct link links[1000000];

int main()
{
	long n, k;
	cin >> n >> k;
	memset(mas, 0, sizeof(struct node*));
	for (long i = 0; i < n; i++)
	{
		long t;
		cin >> t;
		struct node *p = new struct node;
		p->next = mas[t];
		p->number = i;
		mas[t] = p;
	}
	long size = 0;
	if (mas[0]->next != 0)
	{
		cout << -1;
		return 0;
	}
	memset(neighbours, 0, 100000*sizeof(long));
	for (long i = 1; i < n; i++)
	{
		struct node *p;
		p = mas[i];
		struct node *q;
		q = mas[i-1];
		while (p)
		{
			while ((q) && (neighbours[q->number] >= k))
				q = q->next;
			if (q == 0)
			{
				cout << -1;
				return 0;
			}
			neighbours[p->number]++;
			neighbours[q->number]++;
			links[size].a = p->number;
			links[size++].b = q->number;
			p = p->next;
		}
	}
	cout << size << endl;
	for (long i = 0; i < size; i++)
		cout << links[i].a+1 << ' ' << links[i].b+1 << endl;
	return 0;
}