#include<bits/stdc++.h>
using namespace std;
#define int long long
#define f first
#define s second
pair<int,int> a[10000];
int d[20000];
int k[20000];
int32_t main(){
int n;
cin>>n;
for(int x,y,i=0;i<n;i++){
cin>>x>>y;
a[i].f=x;
a[i].s=y;
}
for(int i=0;i<n;i++){
int x;cin>>x;
d[i]=x;
}
for(int i=0;i<n;i++){
int y; cin>>y;
k[i]=y;
}
priority_queue<pair<int,int>, vector<pair<int,int> >, greater<pair<int,int> > > pq;
int c[10000]={0};
for(int i=0;i<n;i++) c[i]=i;
for(int i=0;i<n;i++){
pq.push({d[i],i});
}
int ct[20000];
while(!pq.empty()){
pair<int,int> p=pq.top();
for(int i=0;i<n;i++){
if(i==p.s || i==c[p.s]) continue;
int dist=abs(a[i].f-a[p.s].f)+abs(a[i].s-a[p.s].s);
if(d[i]>((k[p.s]+k[i])*dist) ){
d[i]=((k[p.s]+k[i])*dist);
pq.push({d[i],i});
c[i]=c[p.s];
ct[i]=p.s;
}
}
pq.pop();
}
int ans=0;
for(int i=0;i<n;i++){
ans+=d[i];
}
cout<<ans<<"\n";
int ps=0,con=0;
vector<int> v;
vector<pair<int,int> > edge;
for(int i=0;i<n;i++){
if(c[i]==i){
ps++;
v.push_back(i+1);
}
else {
con++;
edge.push_back({i,ct[i]});
}
}
cout<<ps<<"\n";
for(int i=0;i<v.size();i++){
cout<<v[i]<<" ";
}
cout<<"\n";
cout<<con<<"\n";
for(int i=0;i<edge.size();i++){
cout<<edge[i].f+1<<" "<<edge[i].s+1<<"\n";
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBpbnQgbG9uZyBsb25nCiNkZWZpbmUgZiBmaXJzdAojZGVmaW5lIHMgc2Vjb25kCnBhaXI8aW50LGludD4gYVsxMDAwMF07CmludCBkWzIwMDAwXTsKaW50IGtbMjAwMDBdOwppbnQzMl90IG1haW4oKXsKICBpbnQgbjsKICBjaW4+Pm47CiAgZm9yKGludCB4LHksaT0wO2k8bjtpKyspewogICAgIGNpbj4+eD4+eTsKICAgICBhW2ldLmY9eDsKICAgICBhW2ldLnM9eTsKICB9CiAgZm9yKGludCBpPTA7aTxuO2krKyl7CiAgICBpbnQgeDtjaW4+Png7CiAgICBkW2ldPXg7CiAgfQogIGZvcihpbnQgaT0wO2k8bjtpKyspewogICAgaW50IHk7IGNpbj4+eTsKICAgIGtbaV09eTsKICB9CiAgcHJpb3JpdHlfcXVldWU8cGFpcjxpbnQsaW50PiwgdmVjdG9yPHBhaXI8aW50LGludD4gPiwgZ3JlYXRlcjxwYWlyPGludCxpbnQ+ID4gPiBwcTsKICBpbnQgY1sxMDAwMF09ezB9OwogIGZvcihpbnQgaT0wO2k8bjtpKyspIGNbaV09aTsKICBmb3IoaW50IGk9MDtpPG47aSsrKXsKICAgIHBxLnB1c2goe2RbaV0saX0pOwogIH0KICBpbnQgY3RbMjAwMDBdOwogIHdoaWxlKCFwcS5lbXB0eSgpKXsKICAgICBwYWlyPGludCxpbnQ+IHA9cHEudG9wKCk7CiAgICAgZm9yKGludCBpPTA7aTxuO2krKyl7CiAgICAgICBpZihpPT1wLnMgfHwgaT09Y1twLnNdKSBjb250aW51ZTsKICAgICAgIGludCBkaXN0PWFicyhhW2ldLmYtYVtwLnNdLmYpK2FicyhhW2ldLnMtYVtwLnNdLnMpOwogICAgICAgaWYoZFtpXT4oKGtbcC5zXStrW2ldKSpkaXN0KSApewogICAgICAgICBkW2ldPSgoa1twLnNdK2tbaV0pKmRpc3QpOwogICAgICAgICBwcS5wdXNoKHtkW2ldLGl9KTsKICAgICAgICAgY1tpXT1jW3Auc107CiAgICAgICAgIGN0W2ldPXAuczsKICAgICAgIH0KICAgICB9CiAgICAgcHEucG9wKCk7CiAgfQogIGludCBhbnM9MDsKICBmb3IoaW50IGk9MDtpPG47aSsrKXsKICAgIGFucys9ZFtpXTsKICB9CiAgY291dDw8YW5zPDwiXG4iOwogIGludCBwcz0wLGNvbj0wOwogIHZlY3RvcjxpbnQ+IHY7CiAgdmVjdG9yPHBhaXI8aW50LGludD4gPiBlZGdlOwogIGZvcihpbnQgaT0wO2k8bjtpKyspewogICAgaWYoY1tpXT09aSl7CiAgICAgIHBzKys7CiAgICAgIHYucHVzaF9iYWNrKGkrMSk7CiAgICB9CiAgICBlbHNlIHsKICAgICAgY29uKys7CiAgICAgIGVkZ2UucHVzaF9iYWNrKHtpLGN0W2ldfSk7CiAgICB9CiAgfQogIGNvdXQ8PHBzPDwiXG4iOwogIGZvcihpbnQgaT0wO2k8di5zaXplKCk7aSsrKXsKICAgIGNvdXQ8PHZbaV08PCIgIjsKICB9CiAgY291dDw8IlxuIjsKICBjb3V0PDxjb248PCJcbiI7CiAgZm9yKGludCBpPTA7aTxlZGdlLnNpemUoKTtpKyspewogICAgY291dDw8ZWRnZVtpXS5mKzE8PCIgIjw8ZWRnZVtpXS5zKzE8PCJcbiI7CiAgfQp9