Vasiliy lives at point (a, b) of the coordinate plane. He is hurrying up to work so he wants to get out of his house as soon as possible. New app suggested n available Beru-taxi nearby. The i-th taxi is located at point (xi, yi) and moves with a speed vi. 

Consider that each of n drivers will move directly to Vasiliy and with a maximum possible speed. Compute the minimum time when Vasiliy will get in any of Beru-taxi cars.

Input

The first line of the input contains two integers a and b ( - 100 ≤ a, b ≤ 100) — coordinates of Vasiliy's home.

The second line contains a single integer n (1 ≤ n ≤ 1000) — the number of available Beru-taxi cars nearby. 

The i-th of the following n lines contains three integers xi, yi and vi ( - 100 ≤ xi, yi ≤ 100, 1 ≤ vi ≤ 100) — the coordinates of the i-th car and its speed.

It's allowed that several cars are located at the same point. Also, cars may be located at exactly the same point where Vasiliy lives.

Output

Print a single real value — the minimum time Vasiliy needs to get in any of the Beru-taxi cars. You answer will be considered correct if its absolute or relative error does not exceed 10 - 6. 

Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if <image>.

Examples

Input

0 0
2
2 0 1
0 2 2


Output

1.00000000000000000000

Input

1 3
3
3 3 2
-2 3 6
-2 7 10


Output

0.50000000000000000000

Note

In the first sample, first taxi will get to Vasiliy in time 2, and second will do this in time 1, therefore 1 is the answer.

In the second sample, cars 2 and 3 will arrive simultaneously.

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * Created by sushilmainali on 22/08/2016.
 */
public class _3671p {

    public static void  main(String [] args) {

        process();

    }

    public static void process(){
        Scanner sc = new Scanner(System.in);
        //String jj = sc.nextLine();
        String [] len = sc.nextLine().split(" ");
        Point user = new Point(Integer.parseInt(len[0]),Integer.parseInt(len[1]));
        user.setDistance(0);
        user.setVelocityFactor(0);
        int numTaxiPoint = sc.nextInt();
       // System.out.println("numTaxiPoint "+numTaxiPoint);
        sc.nextLine();
        List<Point> taxiPoint = new ArrayList<Point>();

        for(int i=0;i<numTaxiPoint;i++) {
            String [] point = sc.nextLine().split(" ");
            Point tempPoint = new  Point(Integer.parseInt(point[0]),Integer.parseInt(point[1]));
            tempPoint.setSpeed(Integer.parseInt(point[2])); // set Speed
            tempPoint.setDistance(tempPoint.distance(user)); // Set Distance
            tempPoint.setVelocityFactor(tempPoint.getDistance() / tempPoint.getSpeed());
            taxiPoint.add(tempPoint);
        }

        // Adding Beru location
        taxiPoint.add(user);
        Collections.sort(taxiPoint);
        getShortestDistance(taxiPoint, user);

//        for(int i=0; i<taxiPoint.size();i++) {
//            System.out.println(taxiPoint.get(i).toString());
//        }

        //Double min = taxiPoint.get(1).getVelocityFactor();
//        Double truncatedDouble = new BigDecimal(min)
//                .movePointLeft(6)
//                .doubleValue();


        System.out.println(taxiPoint.get(1).getVelocityFactor());


    }


    public static void getShortestDistance(List sortedList, Point beruPoint) {
        //int location = sortedList.get(sortedList.indexOf(beruPoint));
        int location = sortedList.indexOf(beruPoint);
        //System.out.println("index of beru "+ location);

    }


    public static class Point implements Comparable<Point>{

        private int x;
        private int y;
        private int speed;
        private double distance;

        public double getVelocityFactor() {
            return velocityFactor;
        }

        public void setVelocityFactor(double velocityFactor) {
            this.velocityFactor = velocityFactor;
        }

        private double velocityFactor;


        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }



        public void setX(int x) {
            this.x = x;
        }

        public void setY(int y) {
            this.y = y;
        }

        public int getX() {
            return x;
        }

        public int getY() {
            return y;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        @Override
        public int compareTo(Point o) {

            //return Integer.compare(this.getX(), o.getX());
            // comparing distance and speed
            return Double.compare(this.getVelocityFactor(), o.getVelocityFactor());
        }

        public double distance(Point o2)
        {
            double dist = Math.sqrt(Math.pow(Math.abs(this.x - o2.x),2) + Math.pow(Math.abs(this.y - o2.y),2));
            return dist;
        }


        @Override
        public String toString() {
            return "[ "+this.getX() + " , "+this.getY()+ "," + this.getVelocityFactor()+"]";
        }

        public double getDistance() {
            return distance;
        }

        public void setDistance(double distance) {
            this.distance = distance;
        }
    }

}
