Problem: The crowdedness of the discotheque would never stop our friends from having fun, but a bit more spaciousness won't hurt, will it?

The discotheque can be seen as an infinite xy-plane, in which there are a total of n dancers. Once someone starts moving around, they will move only inside their own movement range, which is a circular area Ci described by a center (xi, yi) and a radius ri. No two ranges' borders have more than one common point, that is for every pair (i, j) (1 ≤ i < j ≤ n) either ranges Ci and Cj are disjoint, or one of them is a subset of the other. Note that it's possible that two ranges' borders share a single common point, but no two dancers have exactly the same ranges.

Tsukihi, being one of them, defines the spaciousness to be the area covered by an odd number of movement ranges of dancers who are moving. An example is shown below, with shaded regions representing the spaciousness if everyone moves at the same time.

<image>

But no one keeps moving for the whole night after all, so the whole night's time is divided into two halves — before midnight and after midnight. Every dancer moves around in one half, while sitting down with friends in the other. The spaciousness of two halves are calculated separately and their sum should, of course, be as large as possible. The following figure shows an optimal solution to the example above.

<image>

By different plans of who dances in the first half and who does in the other, different sums of spaciousness over two halves are achieved. You are to find the largest achievable value of this sum.

Input

The first line of input contains a positive integer n (1 ≤ n ≤ 1 000) — the number of dancers.

The following n lines each describes a dancer: the i-th line among them contains three space-separated integers xi, yi and ri ( - 106 ≤ xi, yi ≤ 106, 1 ≤ ri ≤ 106), describing a circular movement range centered at (xi, yi) with radius ri.

Output

Output one decimal number — the largest achievable sum of spaciousness over two halves of the night.

The output is considered correct if it has a relative or absolute error of at most 10 - 9. Formally, let your answer be a, and the jury's answer be b. Your answer is considered correct if <image>.

Examples

Input

5
2 1 6
0 4 1
2 -1 3
1 -2 1
4 -1 1


Output

138.23007676


Input

8
0 0 1
0 0 2
0 0 3
0 0 4
0 0 5
0 0 6
0 0 7
0 0 8


Output

289.02652413

Note

The first sample corresponds to the illustrations in the legend.

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.*;

public class utkarsh {

    InputStream is;
    PrintWriter out;
    
    long maxl = 4L * (long)1e18, mod = (long)1e9 + 7L;
    int p[], maxi = 2 * (int)1e9, sz, np = 15485900, modi = (int)1e9 + 7;
    boolean b[];    // = isPrime();
    
    class point{
        int x, y, r, i;
        point(int a, int b, int c){
            x = a;
            y = b;
            r = c;
            i = 0;
        }
    }
    
    boolean cnt(point u, point v){
        double d = (u.x - v.x + 0.0)*(u.x - v.x) + (u.y - v.y + 0.0)*(u.y - v.y);
        d = Math.sqrt(d);
        return d < (u.r + v.r);
    }
    
    void solve(){
        //Enter code here utkarsh
        //sz=sieve(); //sz = 1000001;
        //out.println(sz);
        int i, j, k, n;
        double l, r;
        n = ni();
        point a[] = new point[n];
        for(i = 0; i < n; i++)  a[i] = new point(ni(), ni(), ni());
        Arrays.sort(a, (point u, point v) -> (v.r - u.r));
        l = r = 0.0;
        ArrayList<point> ll = new ArrayList<>();
        ArrayList<point> rr = new ArrayList<>();
        for(i = 0; i < n; i++){
            if(ll.isEmpty() && rr.isEmpty()){
                ll.add(a[i]);
                l += Math.PI * a[i].r * a[i].r;
            }else if(rr.isEmpty()){
                for(j = 0; j < ll.size(); j++){
                    if(cnt(a[i], ll.get(j))) break;
                }
                if(j == ll.size()){
                    ll.add(a[i]);
                    l += Math.PI * a[i].r * a[i].r;
                }else{
                    rr.add(a[i]);
                    r += Math.PI * a[i].r * a[i].r;
                }
            }else{
                k = 0;
                for(j = ll.size() - 1; j >= 0; j--){
                    if(cnt(a[i], ll.get(j))){
                        if(ll.get(j).i == 1){
                            ll.add(a[i]);
                            l += Math.PI * a[i].r * a[i].r;
                            k = 1;
                        }
                        break;
                    }
                }
                if(j == -1){
                    ll.add(a[i]);
                    l += Math.PI * a[i].r * a[i].r;
                    k = 1;
                }
                if(k == 1)  continue;
                for(j = rr.size() - 1; j >= 0; j--){
                    if(cnt(a[i], rr.get(j))){
                        if(rr.get(j).i == 1){
                            rr.add(a[i]);
                            r += Math.PI * a[i].r * a[i].r;
                            k = 1;
                        }
                        break;
                    }
                }
                if(j == -1){
                    rr.add(a[i]);
                    r += Math.PI * a[i].r * a[i].r;
                    k = 1;
                }
                if(k == 1)  continue;
                a[i].i = 1;
                ll.add(a[i]);
                l -= Math.PI * a[i].r * a[i].r;
            }
        }
        out.println(l + r);
    }
    
    int sieve(){ int i, j, n = np; b = new boolean[n]; for(i = 3; i < n; i += 2){ b[i] = true; } b[2] = true; for(i = 3; i * i <= n; i += 2){ if(b[i]){ for(j = 2 * i; j < n; j += i){ b[j] = false; } } } p = new int[n]; p[0] = 2; j = 1; for(i = 3; i < n; i += 2){ if(b[i]){ p[j++] = i; } } p=Arrays.copyOf(p,j); return j;
    }
    long modpow(long base, long exp, long modulus) { base %= modulus; long result = 1L; while (exp > 0) { if ((exp & 1)==1) result = (result * base) % modulus; base = (base * base) % modulus; exp >>= 1; } return result;
    }
    
    public static void main(String[] args) { new utkarsh().run();
    }
    void run(){ is = System.in; out = new PrintWriter(System.out); solve(); out.flush();
    }
    
    byte input[] = new byte[1024];
    int len = 0, ptr = 0;
    
    int readByte(){ if(ptr >= len){ ptr = 0; try{ len = is.read(input); }catch(IOException e){ throw new InputMismatchException(); } if(len <= 0){ return -1; } } return input[ptr++];
    }
    boolean isSpaceChar(int c){ return !( c >= 33 && c <= 126 ); 
    }
    int skip(){ int b = readByte(); while(b != -1 && isSpaceChar(b)){ b = readByte(); } return b;
    }
    
    char nc(){ return (char)skip();
    }
    String ns(){ int b = skip(); StringBuilder sb = new StringBuilder(); while(!isSpaceChar(b)){ sb.appendCodePoint(b); b=readByte(); } return sb.toString();
    }
    int ni(){ int n = 0,b = readByte(); boolean minus = false; while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')){ b = readByte(); } if(b == '-'){ minus = true; b = readByte(); } if(b == -1){ return -1; } while(b >= '0' && b <= '9'){ n = n * 10 + (b - '0'); b = readByte(); } return minus ? -n : n;
    }
    long nl(){ long n = 0L; int b = readByte(); boolean minus = false; while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')){ b = readByte(); } if(b == '-'){ minus = true; b = readByte(); } while(b >= '0' && b <= '9'){ n = n * 10 + (b - '0'); b = readByte(); } return minus ? -n : n;
    }
    double nd(){ return Double.parseDouble(ns());
    }
    float nf(){ return Float.parseFloat(ns());
    }
    int[] na(int n){ int a[] = new int[n]; for(int i = 0; i < n; i++){ a[i] = ni(); } return a;
    }
    char[] ns(int n){ char c[] = new char[n]; int i,b = skip(); for(i = 0; i < n; i++){ if(isSpaceChar(b)){ break; } c[i] = (char)b; b = readByte(); } return i == n ? c : Arrays.copyOf(c,i);
    }
}