#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int MAX = 105;
int x[MAX], y[MAX];
int sq(int x) { return x * x; }
double dis(int i, int j) { return sqrt(1.0 * sq(x[i] - x[j]) + sq(y[i] - y[j])); }
int par[MAX], sz[MAX], n;
void init(int v) {
	par[v] = v;
	sz[v] = 1;
}
int find(int v) {
	return v == par[v] ? v : par[v] = find(par[v]);
}
void join(int u, int v) {
	u = find(u), v = find(v);
	if(u != v) {
		if(sz[u] < sz[v]) swap(u, v);
		par[v] = u;
		sz[u] += sz[v];
	}
}
bool f(double r) {
	for(int i = 1; i <= n + 2; i ++) init(i);
	// n+1 -> y=-100
	// n+2 -> y=100
	for(int i = 1; i <= n; i ++) {
		if(y[i] - 2 * r < -100) join(i, n + 1);
		if(y[i] + 2 * r > 100) join(i, n + 2);
		for(int j = i + 1; j <= n; j ++) {
			if(dis(i, j) < 2 * r) join(i, j);
		}
	}
	return find(n + 1) != find(n + 2);
}
int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	
	cin >> n;
	for(int i = 1; i <= n; i ++) cin >> x[i] >> y[i];
	double l = 0, r = 100;
	for(int i = 0; i < 100; i ++) {
		double m = (l + r) / 2;
		if(f(m)) l = m;
		else r = m;
	}
	cout << setprecision(10) << fixed << l;

	return 0;
}

// Hope for us because I believed 
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int n;
    cin >> n;
    vector<vector<int>> g(n);
    vector<int> a(n),b(n);
    rep(i,n-1){
        cin >> a[i] >> b[i];
        a[i]--;b[i]--;
        g[a[i]].push_back(b[i]);
        g[b[i]].push_back(a[i]);
    }
    
    int root = 0;
    vector<int> par(n,-1);
    vector<ll> add(n,0);
    ll offset = 0;

    auto dfs = [&](auto self,int v,int p) -> void {
        par[v] = p;
        if(p != -1)add[v] += add[p];
        for(auto nv:g[v]){
            if(nv == p)continue;
            self(self,nv,v);
        }
    };
    
    dfs(dfs,root,-1);

    int q;
    cin >> q;
    rep(i,q){
        int t,e,x;
        cin >> t >> e >> x;
        e--;
        int A = a[e];
        int B = b[e];
        if(t == 1)swap(A,B);
        if(par[B] == A)add[B] += x;
        else add[A] -= x, offset += x;
    }
    dfs(dfs,root,-1);
    for(auto v:add)cout << v + offset << endl;
}