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.awt.*;
import java.io.*;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class Main {

    static Main.MyScanner sc = new Main.MyScanner();

    static PrintWriter out = new PrintWriter(System.out);
//    static PrintStream out = System.out;


    public static void main(String[] args) throws ParseException {

        int n = sc.nextInt() ;
        class circle{
            int x,y;
            double r ;
            ArrayList<circle> children ;

            public circle(int x,int y,double r) {
                this.x = x ;
                this.y = y ;
                this.r = r ;
                children = new ArrayList<circle>() ;
            }
            public double area() {
                return r * r ;
            }
            public boolean contains(circle c) {
                long xa = x -  c.x ;
                long ya = y - c.y ;
                return Math.sqrt(xa * xa + ya * ya) <= r || Math.sqrt(xa * xa + ya * ya) <= c.r ;
            }
        }

        circle arr[] = new circle[n] ;

        for(int i = 0 ; i < n ; i++) arr[i] = new circle(sc.nextInt(),sc.nextInt(),sc.nextInt()) ;

        Arrays.sort(arr, new Comparator<circle>() {
            @Override
            public int compare(circle a, circle b) {
                return (int) (b.r - a.r);
            }
        });

        ArrayList<circle> dp = new ArrayList<>() ;

        for(int i = 0 ; i < arr.length ; i++) {
            boolean found = false ;
            circle now = arr[i] ;
            for(circle x : dp) {
                circle root = x ;
                while (root.contains(now)) {
                    found = true ;
                    boolean childFound = false ;
                    for(circle child : root.children) if(child.contains(now)) {
                        childFound = true ;
                        root = child ;
                        break;
                    }
                    if(!childFound) {
                        root.children.add(now) ;
                        break;
                    }
                }
            }
            if(!found) {
                dp.add(now) ;
            }
        }

        double ans = 0 ;

        for(circle g : dp) {
            circle root = g ;
            ans += root.area() ;
            boolean add = true ;
            ArrayList<circle> lev = root.children ;
            while (!lev.isEmpty()) {
                ArrayList<circle> nxtLev = new ArrayList<circle>() ;
                for(circle x : lev) {
                    if(add) ans += x.area() ;
                    else ans -= x.area();
                    nxtLev.addAll(x.children) ;
                }
                add = !add ;
                lev = nxtLev ;
            }
        }

        System.out.println(ans*sc.pi);

        out.close();
    }

    private static void solve(int n) {
        ArrayList<TreeMap<Character,Long>> al = new ArrayList<>() ;
        char car = 'a' ;
        for(int i = 1 ; i <= n ; i++,car++) {
            al.add(set(car,1l)) ;
        }
        int sym = 0 ;
        while (al.size() > 1) {
            ArrayList<TreeMap<Character,Long>> temp = new ArrayList<>() ;
            for(int i = 0 ; i < al.size()-1 ; i++) {
                if(sym%2 == 0)
                    temp.add(add(al.get(i),al.get(i+1))) ;
                else
                    temp.add(sub(al.get(i),al.get(i+1))) ;
                sym++;
            }
            al = temp ;
        }
        print(al.get(0),n);
    }

    public static TreeMap<Character,Long> set(Character v,Long c) {
        TreeMap<Character,Long> x = new TreeMap<>() ;
        x.put(v,c) ;
        return x ;
    }

    public static void print(TreeMap<Character, Long> tree, int n) {
        char a = 'a' ;
        for(int i = 0 ; i < n ; i++) {
            long l = 0 ;
            if(tree.containsKey(a)) l = tree.get(a) ;
            System.out.print(l + ", ");
            a++;
        }
        System.out.println();
    }

    public static TreeMap<Character,Long> sub(TreeMap<Character,Long> a,TreeMap<Character,Long> b) {
        TreeMap<Character,Long> ans = new TreeMap<>() ;
        for(Character x : a.keySet()) if(b.containsKey(x)) {
            long c = a.get(x) - b.get(x) ;
            if(c != 0) ans.put(x,c) ;
        }

        for(Character x : a.keySet()) if(!b.containsKey(x)) ans.put(x,a.get(x)) ;
        for(Character x : b.keySet()) if(!a.containsKey(x)) ans.put(x,b.get(x)*-1) ;

        return ans ;
    }

    public static TreeMap<Character,Long> add(TreeMap<Character,Long> a,TreeMap<Character,Long> b) {
        TreeMap<Character,Long> ans = new TreeMap<>() ;
        for(Character x : a.keySet()) if(b.containsKey(x)) {
            long c = a.get(x) + b.get(x) ;
            if(c != 0) ans.put(x,c) ;
        }

        for(Character x : a.keySet()) if(!b.containsKey(x)) ans.put(x,a.get(x)) ;
        for(Character x : b.keySet()) if(!a.containsKey(x)) ans.put(x,b.get(x)) ;

        return ans ;
    }

    static private class MyScanner {

        static public class Fen {
            public static long read(long[] tree,int idx){
                int sum = 0;
                while (idx > 0){
                    sum += tree[idx];
                    idx -= (idx & -idx);
                }
                return sum;
            }

            public static void update(long[] tree,int idx ,long val){
                int MaxVal = tree.length - 1 ;
                while (idx <= MaxVal){
                    tree[idx] += val;
                    idx += (idx & -idx);
                }
            }

        }
        Fen fen = new Fen();
        Double pi = 3.141592653589793238462643383279;


        private static int[] compress(int[] arr) {
            int temp[] = new int[arr.length] ;
            for(int i = 0 ; i < arr.length ; i++) temp[i] = arr[i] ;
            Arrays.sort(temp);
            HashMap<Integer,Integer> hm = new HashMap<>() ;
            int point = 1 ;
            for(Integer x : temp) {
                if(!hm.containsKey(x)) {
                    hm.put(x,point++) ;
                }
            }
            for(int i = 0 ; i < arr.length ; i++) arr[i] = hm.get(arr[i]) ;
            return arr;
        }

        BufferedReader br;

        StringTokenizer st;

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

        public long mod(long x) {
            // TODO Auto-generated method stub
            return (x % 1000000007);
        }

        boolean hasNext() {
            if (st.hasMoreElements())
                return true;
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.hasMoreTokens();
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    }

}