private void go(){
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int ppl = in.nextInt();
		ArrayList<City> l = new ArrayList<City>();
		for(int i=0;i<n;i++){
			l.add(new City(in.nextInt(), in.nextInt(), in.nextInt()));
		}
		Collections.sort(l);
		double r = 0;
		for(int i=0;i<l.size();i++){
//			System.out.println(l.get(i).x + " " + l.get(i).y + " " + ppl);
			if(Math.abs(ppl-1e6) < 1e-6 || ppl>1e6) break;
			ppl+=l.get(i).popu;
			r=Math.sqrt(l.get(i).x*l.get(i).x+l.get(i).y*l.get(i).y);
		}
		if(ppl<1e6) r = -1;
		System.out.println(r);
	}