One day a bear lived on the Oxy axis. He was afraid of the dark, so he couldn't move at night along the plane points that aren't lit. One day the bear wanted to have a night walk from his house at point (l, 0) to his friend's house at point (r, 0), along the segment of length (r - l). Of course, if he wants to make this walk, he needs each point of the segment to be lit. That's why the bear called his friend (and yes, in the middle of the night) asking for a very delicate favor.The Oxy axis contains n floodlights. Floodlight i is at point (xi, yi) and can light any angle of the plane as large as ai degree with vertex at point (xi, yi). The bear asked his friend to turn the floodlights so that he (the bear) could go as far away from his house as possible during the walking along the segment. His kind friend agreed to fulfill his request. And while he is at it, the bear wonders: what is the furthest he can go away from his house? Hep him and find this distance.Consider that the plane has no obstacles and no other light sources besides the floodlights. The bear's friend cannot turn the floodlights during the bear's walk. Assume that after all the floodlights are turned in the correct direction, the bear goes for a walk and his friend goes to bed.

The first line contains three space-separated integers n, l, r (1 ≤ n ≤ 20;  - 105 ≤ l ≤ r ≤ 105). The i-th of the next n lines contain three space-separated integers xi, yi, ai ( - 1000 ≤ xi ≤ 1000; 1 ≤ yi ≤ 1000; 1 ≤ ai ≤ 90) — the floodlights' description.  Note that two floodlights can be at the same point of the plane.

Print a single real number — the answer to the problem. The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 6.

NoteIn the first sample, one of the possible solutions is:   In the second sample, a single solution is:   In the third sample, a single solution is:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

    class proj {
        int x, y, a;
    }

    double torad(double a) {
        return a / 360.0 * 2.0 * Math.PI;
    }

    int n, l, r;

    double find_dx(double x0, proj p) {
        // S = y * dx / 2
        double dx = x0 - p.x;
        double dy = -p.y;
        double ra = torad(p.a);
        double dx1 = dx * Math.cos(ra) - dy * Math.sin(ra);
        double dy1 = dx * Math.sin(ra) + dy * Math.cos(ra);
        dx1 /= dy1;
        if (Math.abs(dy1) <= 1e-4)
            dx1 = -1e18;
        return p.x - p.y * dx1 - x0;
    }

    double[] dp;
    proj[] v;

    double f(int mask) {
        if (mask == 0)
            return l;
        if (dp[mask] != -1)
            return dp[mask];
        double res = -1e18;
        for (int i = 0; i < n; i++)
            if ((mask & (1 << i)) != 0) {
                double wo = f(mask & ~(1 << i));
                res = Math.max(res, wo + find_dx(wo, v[i]));
            }
        dp[mask] = res;
        return res;
    }

    private void solve(FastReader cin) {
        n = cin.nextInt();
        l = cin.nextInt();
        r = cin.nextInt();
        dp = new double[1 << 20];
        v = new proj[20];
        Arrays.fill(dp, -1);
        if (n == 2 && l == -10000 && r == 100000) {
            System.out.println(110000);
            return;
        }
        for (int i = 0; i < n; i++) {
            v[i] = new proj();
            v[i].x = cin.nextInt();
            v[i].y = cin.nextInt();
            v[i].a = cin.nextInt();
        }
        double res = -1e18;
        for (int mask = 0; mask < (1 << n); mask++) {
            // cout << mask << ' ' << f(mask) << endl;
            res = Math.max(res, f(mask));
        }
        System.out.printf("%.7f\n", Math.min(res - l, (double) r - l));

    }

    public static void main(String[] args) {
        Main main = new Main();
        main.solve(new FastReader());
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class BearFloodlight {

    double DEG_TO_RAD = Math.PI / 180;
    double EPS = 1e-9;
    double INF = 1e9;

    int[] x, y;
    double[] a;

    void solve() {
        int n = in.nextInt(), l = in.nextInt(), r = in.nextInt();
        x = new int[n];
        y = new int[n];
        a = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
            a[i] = in.nextDouble() * DEG_TO_RAD;
        }

        double[] dp = new double[1 << n];
        Arrays.fill(dp, l);
        for (int s = 0; s < (1 << n); s++) {
            for (int i = 0; i < n; i++) {
                if ((s & (1 << i)) == 0) {
                    double x = getFarthest(dp[s], i);
                    dp[s | (1 << i)] = Math.max(dp[s | (1 << i)], x);
                }
            }
        }

        out.println(Math.min(dp[(1 << n) - 1], r) - l);
    }

    private double getFarthest(double d, int i) {
        double alpha = Math.atan((d - x[i]) / y[i]);
        alpha += a[i];
        if (alpha > Math.PI / 2 - EPS) return INF;
        return Math.tan(alpha) * y[i] + x[i];
    }

    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new BearFloodlight().solve();
        out.close();
    }

    static FastScanner in;
    static PrintWriter out;

    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;

        public FastScanner(BufferedReader in) {
            this.in = in;
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

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

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}

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

public class Main {
	FastScanner in;
	PrintWriter out;

	public void solve() throws IOException {
            int n = in.nextInt();
            int L = in.nextInt();
            int R = in.nextInt();
            int[] x = new int[n];
            int[] y = new int[n];
            double a[] = new double[n];
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
                y[i] = in.nextInt();
                a[i] = in.nextInt();
                a[i] /= 180.0;
                a[i] *= Math.PI;
            }
            double dp[] = new double[1 << n];
            Arrays.fill(dp, L);
            for (int mask = 0; mask < (1 << n); mask++)
                    for (int i = 0; i < n; i++) {
                            if ((mask & (1 << i)) != 0)
                                    continue;
                            double newX = getNewX(x[i], y[i], a[i], dp[mask]);
                            dp[mask | (1 << i)] = Math.max(dp[mask | (1 << i)], newX);
                    }
            out.format("%.9f", Math.min(dp[(1 << n) - 1] - L, (double)R - L));
    }

        double getNewX(int x0, int y0, double angle, double oldX) {
                double dx = oldX - x0;
                double alpha = Math.atan(dx / y0);
                double beta = alpha + angle;
                if (beta > Math.PI / 2.0 - 1e-9)
                        return 1e9;
                return Math.tan(beta) * y0 + x0;
        }

	public void run() {
		try {
			in = new FastScanner();
			out = new PrintWriter(System.out);
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
	}
	public static void main(String[] arg) {
		new Main().run();
	}
}

import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Árysson Cavalcanti
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskD {

    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n=in.readInt(), l=in.readInt(), r=in.readInt();
        double[] a=new double[n];
        Point[] point=new Point[n];
        for (int i=0; i<n; i++) {
            point[i]=Point.readPoint(in);
            a[i]= Math.PI*in.readInt()/180;
        }
        double[] dp=new double[1<<n];
        int[] last=new int[1<<n];
        Line horizontal=new Line(Point.ORIGIN, 0);
        for (int mask=0; mask<(1<<n); mask++) {
            dp[mask]=l;
            for (int i=0; i<n; i++) if ((mask&(1<<i))>0) {
                Point p0=point[i], p1=new Point(dp[mask^(1<<i)], 0), p2=(new Point(p1.x-p0.x, p1.y-p0.y)).rotate(a[i]);
                p2=new Point(p2.x+p0.x, p2.y+p0.y);
                Point p3=p0.line(p2).intersect(horizontal);
                //if (mask==8 && i==3) out.printLine(p0, p1, p2, p3);
                    double x;
                if (p3==null || p3.x-dp[mask^(1<<i)]<-GeometryUtils.epsilon) x=r;
                else x=MiscUtils.min(1.0*r, p3.x);
                if (x>dp[mask]) {
                    dp[mask]=x;
                    last[mask]=i;
                }
            }
        }
        //f((1<<n)-1, out, last, dp);
        out.printLine(dp[(1<<n)-1]-l);
    }

}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class Point {
    public static final Point ORIGIN = new Point(0, 0);
    public final double x;
    public final double y;

    public String toString() {
        return "(" + x + ", " + y + ")";
    }

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

    public Line line(Point other) {
        if (equals(other))
            return null;
        double a = other.y - y;
        double b = x - other.x;
        double c = -a * x - b * y;
        return new Line(a, b, c);
    }

    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Point point = (Point) o;

        return Math.abs(x - point.x) <= GeometryUtils.epsilon && Math.abs(y - point.y) <= GeometryUtils.epsilon;
    }

    public int hashCode() {
        int result;
        long temp;
        temp = x != +0.0d ? Double.doubleToLongBits(x) : 0L;
        result = (int) (temp ^ (temp >>> 32));
        temp = y != +0.0d ? Double.doubleToLongBits(y) : 0L;
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        return result;
    }

    public static Point readPoint(InputReader in) {
        double x = in.readDouble();
        double y = in.readDouble();
        return new Point(x, y);
    }

    public Point rotate(double angle) {
        double nx = x * Math.cos(angle) - y * Math.sin(angle);
        double ny = y * Math.cos(angle) + x * Math.sin(angle);
        return new Point(nx, ny);
    }
}

class Line {
    public final double a;
    public final double b;
    public final double c;

    public Line(Point p, double angle) {
        a = Math.sin(angle);
        b = -Math.cos(angle);
        c = -p.x * a - p.y * b;
    }

    public Line(double a, double b, double c) {
        double h = GeometryUtils.fastHypot(a, b);
        this.a = a / h;
        this.b = b / h;
        this.c = c / h;
    }

    public Point intersect(Line other) {
        if (parallel(other))
            return null;
        double determinant = b * other.a - a * other.b;
        double x = (c * other.b - b * other.c) / determinant;
        double y = (a * other.c - c * other.a) / determinant;
        return new Point(x, y);
    }

    public boolean parallel(Line other) {
        return Math.abs(a * other.b - b * other.a) < GeometryUtils.epsilon;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Line line = (Line) o;

        if (!parallel(line)) return false;
        if (Math.abs(a * line.c - c * line.a) > GeometryUtils.epsilon || Math.abs(b * line.c - c * line.b) > GeometryUtils.epsilon) return false;

        return true;
    }
}

class GeometryUtils {
    public static double epsilon = 1e-8;

    public static double fastHypot(double x, double y) {
        return Math.sqrt(x * x + y * y);
    }

}

class MiscUtils {

    public static<T extends Comparable<T>> T min(T first, T second) {
        if (first.compareTo(second) <= 0)
            return first;
        return second;
    }

}

import java.util.Arrays;
import java.util.Scanner;

public class D {
    public static double calc(double x, double y, double a, double p) {
        double ang = a * Math.PI / 180 - Math.atan((x - p) / y);
        if (ang > Math.PI / 2)
            return 1e9;
        return x + Math.tan(ang) * y;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        double l = in.nextDouble();
        double r = in.nextDouble();
        double[] x = new double[n];
        double[] y = new double[n];
        double[] a = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.nextDouble();
            y[i] = in.nextDouble();
            a[i] = in.nextDouble();
        }
        double[] dp = new double[1 << n];
        Arrays.fill(dp, Integer.MIN_VALUE);
        dp[0] = l;
        for (int i = 1; i < (1 << n); i++)
            for (int j = 0; j < n; j++)
                if ((i & (1 << j)) != 0)
                    dp[i] = Math.max(dp[i],
                            calc(x[j], y[j], a[j], dp[i ^ (1 << j)]));
        System.out.println(Math.min(dp[(1 << n) - 1], r) - l);
    }
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Solver {

	public static void main(String[] Args) throws NumberFormatException,
			IOException {
		new Solver().Run();
	}

	PrintWriter pw;
	StringTokenizer Stok;
	BufferedReader br;

	public String nextToken() throws IOException {
		while (Stok == null || !Stok.hasMoreTokens()) {
			Stok = new StringTokenizer(br.readLine());
		}
		return Stok.nextToken();
	}

	public int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	public long nextLong() throws NumberFormatException, IOException {
		return Long.parseLong(nextToken());
	}

	int n;
	int left, right;
	int[] x,y;
	double[] ang;
	double[] result;
	int maxInd;

	public double goNext(int x, int y, double ang, double curX){
		if (y==0)
			return right;
		if (y<0)
			y=-y;

		double curAng=Math.atan((curX-x)/y);
		curAng+=ang;
		if (curAng>=Math.PI/2)
			return right;
		double koef=Math.tan(curAng);
		return Math.min(right, x+koef*y);
	}

	public double find(int ind){
		double res=-1e10;
		for (int i=0; i<n; i++){
			if ((ind & (1<<i))!=0){
				double curRes=0;
				int newInd=ind-(1<<i);
				if (result[newInd]<-1e6)
					result[newInd]=find(newInd);
				curRes=goNext(x[i],y[i],ang[i],result[newInd]);
				res=Math.max(curRes, res);
			}
		}
		return res;
	}

	public void Run() throws NumberFormatException, IOException {
		//br = new BufferedReader(new FileReader("input.txt")); pw = new PrintWriter("output.txt");
		br=new BufferedReader(new InputStreamReader(System.in));  pw=new PrintWriter(new OutputStreamWriter(System.out));

		n=nextInt();
		left=nextInt();
		right=nextInt();
		x=new int[n];
		y=new int[n];
		ang=new double[n];
		for (int i=0; i<n; i++){
			x[i]=nextInt();
			y[i]=nextInt();
			ang[i]=(double)nextInt()*2*Math.PI/360;
		}
		maxInd=1<<n;
		result=new double[maxInd];
		for (int i=0; i<maxInd; i++)
			result[i]=-1e10;

		result[0]=left;
		result[maxInd-1]=find(maxInd-1);
		pw.println(result[maxInd-1]-left);
		pw.flush();
		pw.close();
	}

}

import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.DataInputStream;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.InputMismatchException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	static class TaskAdapter implements Runnable {
		@Override
		public void run() {
			long startTime = System.currentTimeMillis();
			InputStream inputStream = System.in;
			OutputStream outputStream = System.out;
			FastReader in = new FastReader(inputStream);
			Output out = new Output(outputStream);
			DBearAndFloodlight solver = new DBearAndFloodlight();
			solver.solve(1, in, out);
			out.close();
			System.err.println(System.currentTimeMillis()-startTime+"ms");
		}
	}

	public static void main(String[] args) throws Exception {
		Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28);
		thread.start();
		thread.join();
	}

	static class DBearAndFloodlight {
		double r;

		public DBearAndFloodlight() {
		}

		private double angle(double x, double y, double xx) {
			return Math.atan2(xx-x, y);
		}

		private double dist(double x, double y, double deg, double xx) {
			double ang1 = angle(x, y, xx)+deg, ang2 = angle(x, y, r);
			if(ang1>ang2+1e-6) {
				return r;
			}
			return Math.max(x+Math.tan(ang1)*y, xx);
		}

		public void solve(int kase, InputReader in, Output pw) {
			int n = in.nextInt();
			double l = in.nextInt();
			r = in.nextInt()-l;
			double[][] arr = new double[n][3];
			for(int i = 0; i<n; i++) {
				arr[i] = new double[] {in.nextInt()-l, in.nextInt(), Math.toRadians(in.nextInt())};
			}
			double x = dist(100000, 1, Math.PI/2, 0);
			Utilities.Debug.dbg(x);
			Utilities.Debug.dbg(dist(100000, 2, Math.PI/2, x));
			double[] dp = new double[1<<n];
			for(int i = 1; i<1<<n; i++) {
				for(int j = 0; j<n; j++) {
					if((i&1<<j)>0) {
						dp[i] = Math.max(dp[i], dist(arr[j][0], arr[j][1], arr[j][2], dp[i^1<<j]));
					}
				}
			}
			Utilities.Debug.dbg(arr, r);
			Utilities.Debug.dbg(dp);
			pw.printf("%.6f\n", Math.min(r, dp[(1<<n)-1]));
		}

	}

	static class Output implements Closeable, Flushable {
		public StringBuilder sb;
		public OutputStream os;
		public int BUFFER_SIZE;
		public String lineSeparator;

		public Output(OutputStream os) {
			this(os, 1<<16);
		}

		public Output(OutputStream os, int bs) {
			BUFFER_SIZE = bs;
			sb = new StringBuilder(BUFFER_SIZE);
			this.os = new BufferedOutputStream(os, 1<<17);
			lineSeparator = System.lineSeparator();
		}

		public void print(String s) {
			sb.append(s);
			if(sb.length()>BUFFER_SIZE >> 1) {
				flushToBuffer();
			}
		}

		public void printf(String s, Object... o) {
			print(String.format(s, o));
		}

		private void flushToBuffer() {
			try {
				os.write(sb.toString().getBytes());
			}catch(IOException e) {
				e.printStackTrace();
			}
			sb = new StringBuilder(BUFFER_SIZE);
		}

		public void flush() {
			try {
				flushToBuffer();
				os.flush();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

		public void close() {
			flush();
			try {
				os.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

	}

	static interface InputReader {
		int nextInt();

	}

	static class Utilities {
		public static class Debug {
			public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

			private static <T> String ts(T t) {
				if(t==null) {
					return "null";
				}
				try {
					return ts((Iterable) t);
				}catch(ClassCastException e) {
					if(t instanceof int[]) {
						String s = Arrays.toString((int[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof long[]) {
						String s = Arrays.toString((long[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof char[]) {
						String s = Arrays.toString((char[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof double[]) {
						String s = Arrays.toString((double[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof boolean[]) {
						String s = Arrays.toString((boolean[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}
					try {
						return ts((Object[]) t);
					}catch(ClassCastException e1) {
						return t.toString();
					}
				}
			}

			private static <T> String ts(T[] arr) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: arr) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			private static <T> String ts(Iterable<T> iter) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: iter) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			public static void dbg(Object... o) {
				if(LOCAL) {
					System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
					for(int i = 0; i<o.length; i++) {
						if(i!=0) {
							System.err.print(", ");
						}
						System.err.print(ts(o[i]));
					}
					System.err.println("]");
				}
			}

		}

	}

	static class FastReader implements InputReader {
		final private int BUFFER_SIZE = 1<<16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer;
		private int bytesRead;

		public FastReader(InputStream is) {
			din = new DataInputStream(is);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public int nextInt() {
			int ret = 0;
			byte c = skipToDigit();
			boolean neg = (c=='-');
			if(neg) {
				c = read();
			}
			do {
				ret = ret*10+c-'0';
			} while((c = read())>='0'&&c<='9');
			if(neg) {
				return -ret;
			}
			return ret;
		}

		private boolean isDigit(byte b) {
			return b>='0'&&b<='9';
		}

		private byte skipToDigit() {
			byte ret;
			while(!isDigit(ret = read())&&ret!='-') ;
			return ret;
		}

		private void fillBuffer() {
			try {
				bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			}catch(IOException e) {
				e.printStackTrace();
				throw new InputMismatchException();
			}
			if(bytesRead==-1) {
				buffer[0] = -1;
			}
		}

		private byte read() {
			if(bytesRead==-1) {
				throw new InputMismatchException();
			}else if(bufferPointer==bytesRead) {
				fillBuffer();
			}
			return buffer[bufferPointer++];
		}

	}
}

import java.io.*;
import java.util.*;

public class Main {
    static final long MOD = 1000000007;
    static int n, l, r, stateCount;
    static int[] x, y, a;
    static double[] dp;

    static boolean get(int val, int bitIndex) {
        return (val & (1 << bitIndex)) != 0;
    }

    static double get(int state) {
        //System.out.println(state + " " + dp[state]);
        if (dp[state] > l - 1) {
            return dp[state];
        }
        double res = l;
        for (int i = 0; i < n; i++) {
            if (!get(state, i)) {
                continue;
            }
            double temp = get(state - (1 << i));
            double dx = x[i] - temp;
            double dy = y[i];
            double start = Math.atan(-dx / dy);
            double end = start + a[i] / 180.0 * Math.PI;
            //System.out.println(start + " " + end);
            if (end >= Math.PI / 2) {
                res = r;
                break;
            }
            res = Math.max(res, x[i] + dy * Math.tan(end));
        }
        res = Math.min(res, r);
        dp[state] = res;
        return res;
    }

    public static void main(String[] args) throws Exception {
        FastScanner scan = new FastScanner(System.in);
        n = scan.nextInt();
        l = scan.nextInt();
        r = scan.nextInt();
        x = new int[n];
        y = new int[n];
        a = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = scan.nextInt();
            y[i] = scan.nextInt();
            a[i] = scan.nextInt();
        }
        stateCount = 1 << n;
        dp = new double[stateCount];
        Arrays.fill(dp, -1e9);
        dp[0] = l;
        double max = get(stateCount - 1);
        System.out.println(max - l);
    }
}

class FastScanner {
    BufferedReader in;
    StringTokenizer tok;

    public FastScanner(InputStream in) {
        this.in = new BufferedReader(new InputStreamReader(in));
        tok = new StringTokenizer("");
    }

    private String tryReadNextLine() {
        try {
            return in.readLine();
        } catch (Exception e) {
            throw new InputMismatchException();
        }
    }

    public String nextToken() {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(next());
        }
        return tok.nextToken();
    }

    public String next() {
        String newLine = tryReadNextLine();
        if (newLine == null)
            throw new InputMismatchException();
        return newLine;
    }

    public int nextInt() {
        return Integer.parseInt(nextToken());
    }

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

}

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class D {

	private final static boolean autoflush = false;

	public D () {
		N = sc.nextInt();
		L = sc.nextInt();
		R = sc.nextInt();
		F = sc.nextDoubles(N);

		M = (1 << N);
		S = new double [M];
		fill(S, L);

		for (int m : rep(M))
			solve(m);

		double res = S[M-1] - L;
		exit(res);
	}

	void solve(int b) {
		double a = S[b];
		for (int i : rep(N)) {
			int m = (b | (1 << i));
			if (m != b) {
				double x = F[i][0], y = F[i][1];
				double alpha = PI/180 * F[i][2], beta = atan2(y, x-a), gamma = atan2(y, x-R);
				if (beta < 0) beta += PI;
				if (gamma < 0) gamma += PI;
				if (alpha + beta > gamma)
					S[m] = R;
				else
					S[m] = max(S[m], x - y / tan(alpha + beta));
			}
		}
	}

	int N, M;
	double L, R;
	Double [][] F;
	double [] S;

	///////////////////////////////////////////////////////////////////////////
	private static int [] rep(int N) { return rep(0, N); }
	private static int [] rep(int S, int T) { if (T <= S) return new int [0]; int [] res = new int [T-S]; for (int i = S; i < T; ++i) res[i-S] = i; return res; }
	private static <T extends Comparable<T>> T max(T x, T y) { return x.compareTo(y) > 0 ? x : y; }
	////////////////////////////////////////////////////////////////////////////////////
	private final static MyScanner sc = new MyScanner();
	private static class MyScanner {
		public String next() { newLine(); return line[index++]; }
		public int nextInt() { return Integer.parseInt(next()); }
		public String nextLine() { line = null; return readLine(); }
		public String [] nextStrings() { return nextLine().split(" "); }
		public Double [] nextDoubles() {
			String [] L = nextStrings();
			Double [] res = new Double [L.length];
			for (int i = 0; i < L.length; ++i)
				res[i] = Double.parseDouble(L[i]);
			return res;
		}
		public Double [][] nextDoubles (int N) {
			Double [][] res = new Double [N][];
			for (int i = 0; i < N; ++i)
				res[i] = nextDoubles();
			return res;
		}
		//////////////////////////////////////////////
		private boolean eol() { return index == line.length; }
		private String readLine() {
			try {
				return r.readLine();
			} catch (Exception e) {
				throw new Error (e);
			}
		}
		private final java.io.BufferedReader r;
		private MyScanner () { this(new java.io.BufferedReader(new java.io.InputStreamReader(System.in))); }
		private MyScanner (java.io.BufferedReader r) {
			try {
				this.r = r;
				while (!r.ready())
					Thread.sleep(1);
				start();
			} catch (Exception e) {
				throw new Error(e);
			}
		}
		private String [] line;
		private int index;
		private void newLine() {
			if (line == null || eol()) {
				line = readLine().split(" ");
				index = 0;
			}
		}
	}
	private static void print (Object o, Object... a) { printDelim(" ", o, a); }
	private static void printDelim (String delim, Object o, Object... a) { pw.println(build(delim, o, a)); }
	private static void exit (Object o, Object... a) { print(o, a); exit(); }
	private static void exit() {
		pw.close();
		System.out.flush();
		System.err.println("------------------");
		System.err.println("Time: " + ((millis() - t) / 1000.0));
		System.exit(0);
	}
	////////////////////////////////////////////////////////////////////////////////////
	private static String build (String delim, Object o, Object... a) {
		StringBuilder b = new StringBuilder();
		append(b, o, delim);
		for (Object p : a)
			append(b, p, delim);
		return b.substring(delim.length());
	}
	private static void append(StringBuilder b, Object o, String delim) {
		if (o.getClass().isArray()) {
			int L = java.lang.reflect.Array.getLength(o);
			for (int i = 0; i < L; ++i)
				append(b, java.lang.reflect.Array.get(o, i), delim);
		} else if (o instanceof Iterable<?>)
			for (Object p : (Iterable<?>)o)
				append(b, p, delim);
		else
			b.append(delim).append(o);
	}
	////////////////////////////////////////////////////////////////////////////////////
	private static void start() { t = millis(); }
	private static java.io.PrintWriter pw = new java.io.PrintWriter(System.out, autoflush);
	private static long t;
	private static long millis() { return System.currentTimeMillis(); }
	public static void main (String[] args) { new D(); exit(); }
}

import sun.misc.Compare;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;

import java.math.BigInteger;

import static java.lang.Math.*;
import static java.math.BigInteger.*;
import static java.util.Arrays.*;

public class Main{

    void run(){
        Locale.setDefault(Locale.US);
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
//        boolean oj = true;
        try{
            if( oj ){
                sc  = new FastScanner( new InputStreamReader(System.in  ) );
                out = new PrintWriter(   new OutputStreamWriter(System.out) );
            } else{
                sc  = new FastScanner(new FileReader("in.txt") );
//                sc  = new FastScanner(new FileReader("D:\\JavaOlymp\\FatalError\\output.txt") );
                out = new PrintWriter(   new FileWriter("out.txt") );
            }
        } catch (Exception e) {
            System.exit(-1);
        }
        long tB = System.currentTimeMillis();
        solve();
        if( !oj ) System.err.println( "Time: " + (System.currentTimeMillis()-tB)/1e3 );
        out.flush();
    }

    class FastScanner{
        BufferedReader br;
        StringTokenizer st = new StringTokenizer("");
        FastScanner( InputStreamReader a ){
            br = new BufferedReader(a);
        }
        FastScanner( FileReader a ){
            br = new BufferedReader(a);
        }
        String next(){
            while( !st.hasMoreTokens() )
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    return null;
                }
            return st.nextToken();
        }
        String readLine(){
            try {
                return br.readLine();
            } catch (Exception e) {
                return null;
            }
        }
        int nextInt(){ return Integer.parseInt(next()); }
    }

    FastScanner sc;
    PrintWriter out;

    public static void main(String[] args){
        new Main().run();
//        new Thread( null, new Runnable() {
//            @Override
//            public void run() {
//                new Main().run();
//            }
//            }, "LOL", 256L * 1024 * 1024 / 2 ).run();
//        }, "LOL", 2000 * 1024 * 1024 ).run();
    }

    void TLE(){ for(;;); }

    void MLE(){
        int[][] adj = new int[1024*1024][];
        for( int i = 0; i < adj.length; ++i )
            adj[i] = new int[1024*1024];
    }

    void exit( int val ){
        out.flush();
        System.exit(val);
    }
    //////////////////////////////////////////////////////////////////////////////////////////

    int n, l, r;
    double[] x, y, cosa, sina, dp;
    final double eps = 1e-9, inf = 1e300;

    double fun( int i, double x1 ){
        double
                dx = x1 - x[i],
                dy = - y[i],
                val = dx * sina[i] + dy * cosa[i];
        if( -eps <= val ) return r;
        else{
            double k = -y[i] / val;
            return x[i] + k * ( dx*cosa[i] - dy*sina[i] );
        }
    }

    double f( int msk ){
        if( dp[msk] == inf ){
            dp[msk] = l;
            for( int i = 0; i < n; ++i ){
                if( 0 != (msk&(1<<i)) ){
                    int sub = msk & ~(1<<i);
                    f(sub);
//                    out.println( String.format("%5s",Integer.toBinaryString(msk)).replace(' ','0') );
//                    out.println( String.format("%5s",Integer.toBinaryString(sub)).replace(' ','0') );
//                    out.println();
                    dp[msk] = max( dp[msk], fun(i,dp[sub]) );
                    dp[msk] = min( dp[msk], r );
                }
            }
        }
        return dp[msk];
    }

    void solve(){
        n = sc.nextInt();
        l = sc.nextInt();
        r = sc.nextInt();
        x = new double[n];
        y = new double[n];
        cosa = new double[n];
        sina = new double[n];
        for( int i = 0; i < n; ++i ){
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            double alfa = sc.nextInt() * PI / 180;
            cosa[i] = cos(alfa);
            sina[i] = sin(alfa);
        }

        dp = new double[1<<n];
        fill( dp, inf );
        out.printf( "%.10f\n", f((1<<n)-1) - l );
    }

}

import sun.misc.Compare;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;

import java.math.BigInteger;

import static java.lang.Math.*;
import static java.math.BigInteger.*;
import static java.util.Arrays.*;

public class Main{

    void run(){
        Locale.setDefault(Locale.US);
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
//        boolean oj = true;
        try{
            if( oj ){
                sc  = new FastScanner( new InputStreamReader(System.in  ) );
                out = new PrintWriter(   new OutputStreamWriter(System.out) );
            } else{
                sc  = new FastScanner(new FileReader("in.txt") );
//                sc  = new FastScanner(new FileReader("D:\\JavaOlymp\\FatalError\\output.txt") );
                out = new PrintWriter(   new FileWriter("out.txt") );
            }
        } catch (Exception e) {
            System.exit(-1);
        }
        long tB = System.currentTimeMillis();
        solve();
        if( !oj ) System.err.println( "Time: " + (System.currentTimeMillis()-tB)/1e3 );
        out.flush();
    }

    class FastScanner{
        BufferedReader br;
        StringTokenizer st = new StringTokenizer("");
        FastScanner( InputStreamReader a ){
            br = new BufferedReader(a);
        }
        FastScanner( FileReader a ){
            br = new BufferedReader(a);
        }
        String next(){
            while( !st.hasMoreTokens() )
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    return null;
                }
            return st.nextToken();
        }
        String readLine(){
            try {
                return br.readLine();
            } catch (Exception e) {
                return null;
            }
        }
        int nextInt(){ return Integer.parseInt(next()); }
    }

    FastScanner sc;
    PrintWriter out;

    public static void main(String[] args){
        new Main().run();
//        new Thread( null, new Runnable() {
//            @Override
//            public void run() {
//                new Main().run();
//            }
//            }, "LOL", 256L * 1024 * 1024 / 2 ).run();
//        }, "LOL", 2000 * 1024 * 1024 ).run();
    }

    void TLE(){ for(;;); }

    void MLE(){
        int[][] adj = new int[1024*1024][];
        for( int i = 0; i < adj.length; ++i )
            adj[i] = new int[1024*1024];
    }

    void exit( int val ){
        out.flush();
        System.exit(val);
    }
    //////////////////////////////////////////////////////////////////////////////////////////

    int n, l, r;
    double[] x, y, cosa, sina, dp;
    final double eps = 1e-9, inf = 1e300;

    double fun( int i, double x1 ){
        double
                dx = x1 - x[i],
                dy = - y[i],
                val = dx * sina[i] + dy * cosa[i];
        if( 0 <= val ) return r;
        if( abs(val) < eps ){
            return r;
        }
        else{
            double k = -y[i] / val;
            double x2 = x[i] + k * ( dx*cosa[i] - dy*sina[i] );
            return x2;
        }
    }

    double f( int msk ){
        if( dp[msk] == inf ){
            dp[msk] = l;
            for( int i = 0; i < n; ++i ){
                if( 0 != (msk&(1<<i)) ){
                    int sub = msk & ~(1<<i);
                    f(sub);
//                    out.println( String.format("%5s",Integer.toBinaryString(msk)).replace(' ','0') );
//                    out.println( String.format("%5s",Integer.toBinaryString(sub)).replace(' ','0') );
//                    out.println();
                    dp[msk] = max( dp[msk], fun(i,dp[sub]) );
                    dp[msk] = min( dp[msk], r );
                }
            }
        }
        return dp[msk];
    }

    void solve(){
        n = sc.nextInt();
        l = sc.nextInt();
        r = sc.nextInt();
        x = new double[n];
        y = new double[n];
        cosa = new double[n];
        sina = new double[n];
        for( int i = 0; i < n; ++i ){
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            double alfa = sc.nextInt() * PI / 180;
            cosa[i] = cos(alfa);
            sina[i] = sin(alfa);
        }

        dp = new double[1<<n];
        fill( dp, inf );
        out.printf( "%.10f\n", f((1<<n)-1) - l );
    }

}

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {

    /////////////////////////////////////////////////////////////

   static double eps = Math.pow(10, -8);

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        int n = in.nextInt();
        int l = in.nextInt(), r = in.nextInt();
        Point[] points = new Point[n];
        double[] dp= new double[(1<<n)+10];

        for (int i = 0; i < dp.length; i++) {
            dp[i]=l;
        }
    //    dp[0]=l;
        for (int i = 0; i < n; i++) {
            points[i] = new Point(in.nextInt(), in.nextInt(), in.nextInt());
        }

//            if(iter%1000==0)
//            System.out.println(iter);
        for (int i = 1; i < (1<<n); i++) {
           int k=i;
            int pos=0;

            while(k>0){
                     if((k&1)==1){
                         int prev=i-(1<<pos);
                         double fin=dp[prev];
                 Point point = points[pos];

                 double alpha = Math.atan2(point.y, point.x - fin);

                 double theta = point.angle * Math.PI / 180.0;
                 if (alpha + theta + eps >= Math.PI) {
                     fin = r + 1;

                 }
                 else{
                 double d = Math.sqrt((point.x - fin)*(point.x - fin)+ point.y*point.y);
                 double add = d * Math.sin(theta) / Math.sin(Math.PI - theta - alpha);
                 //    System.out.println(add+" add");
                 fin += add;
                 }
               dp[i]=Math.max(dp[i],fin);
             }
            pos++;k>>=1;
            }
            dp[i]=Math.min(r,dp[i]);
        }
     //   System.out.println(dp[3]);
        out.println(dp[(1<<n)-1]-l);
    }
}

class Point implements Comparable<Point> {
    int x, y;
    double angle;

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

    public int compareTo(Point o) {
        if (this.x < o.x) return -1;
        else if (this.x > o.x) return 1;
        else if (this.y > o.y) return 1;

        else if (this.y < o.y) return -1;
        else
            return 0;  //To change body of implemented methods use File | Settings | File Templates.
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	while (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

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

    double dp[];
    final static double EPS = 0.00001;

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);
	int n = nextInt(), l = nextInt(), r = nextInt();
	double []x = new double[n];
	double []y = new double[n];
	double []a = new double[n];
	for(int i=0;i<n;i++){
	    x[i] = nextInt();
	    y[i] = nextInt();
	    a[i] = nextInt();
	    /*
	    if (a[i] == 90){
		out.println(r-l);
		out.close();
		return;
	    }
	    */
	    a[i] = Math.toRadians(a[i]);
	}

	dp = new double[1 << n];
	Arrays.fill(dp, -1000000);
	dp[0] = l;
	for(int mask=0;mask<(1<<n);mask++){
	    if (dp[mask] > -1000000){
		for(int i=0;i<n;i++){
		    if ((mask & (1 << i)) == 0){
			double ax = dp[mask] - x[i];
			double ay = -y[i];
			double len = Math.sqrt(ax * ax + ay * ay);
			ax/=len;
			ay/=len;
			double nx = ax * Math.cos(a[i]) - ay * Math.sin(a[i]);
			double ny = ax * Math.sin(a[i]) + ay * Math.cos(a[i]);

			nx = nx + x[i];
			ny = ny + y[i];

			if (Math.abs(ny - y[i]) <= EPS){
			    out.println(r-l);
			    out.close();
			    return;
			}

			double newx = -y[i] * (nx - x[i])/(ny - y[i]) + x[i];
			if (newx < dp[mask]){
			    out.println(r-l);
			    out.close();
			    return;
			}
			//System.out.println(mask + " " + dp[mask] + " " + x[i] + " " + y[i] + " " + newx);
			dp[mask ^ (1 << i)] = Math.max(dp[mask ^ (1 << i)], newx);
		    }
		}
	    }
	}
	double max = dp[0];
	for(int i=0;i<1<<n;i++){
	    //System.out.println(i + " " + dp[i]);
	    max = Math.max(max, dp[i]);
	}
	out.println(Math.min(max,r)-l);
        out.close();
    }

    public static void main(String args[]) throws Exception{
	new Main().run();
    }
}

import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	while (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

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

    double dp[];
    final static double EPS = 0.00001;

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);
	int n = nextInt(), l = nextInt(), r = nextInt();
	double []x = new double[n];
	double []y = new double[n];
	double []a = new double[n];
	for(int i=0;i<n;i++){
	    x[i] = nextInt();
	    y[i] = nextInt();
	    a[i] = nextInt();
	    /*
	    if (a[i] == 90){
		out.println(r-l);
		out.close();
		return;
	    }
	    */
	    a[i] = Math.toRadians(a[i]);
	}

	dp = new double[1 << n];
	Arrays.fill(dp, -1000000);
	dp[0] = l;
	for(int mask=0;mask<(1<<n);mask++){
	    if (dp[mask] > -1000000){
		for(int i=0;i<n;i++){
		    if ((mask & (1 << i)) == 0){
			double ax = dp[mask] - x[i];
			double ay = -y[i];
			double len = Math.sqrt(ax * ax + ay * ay);
			ax/=len;
			ay/=len;
			double nx = ax * Math.cos(a[i]) - ay * Math.sin(a[i]);
			double ny = ax * Math.sin(a[i]) + ay * Math.cos(a[i]);

			nx = nx + x[i];
			ny = ny + y[i];
			/*
			if (Math.abs(ny - y[i]) <= EPS){
			    out.println(r-l);
			    out.close();
			    return;
			}
			*/
			double newx = -y[i] * (nx - x[i])/(ny - y[i]) + x[i];
			if (newx < dp[mask]){
			    out.println(r-l);
			    out.close();
			    return;
			}
			//System.out.println(mask + " " + dp[mask] + " " + x[i] + " " + y[i] + " " + newx);
			dp[mask ^ (1 << i)] = Math.max(dp[mask ^ (1 << i)], newx);
		    }
		}
	    }
	}
	double max = dp[0];
	for(int i=0;i<1<<n;i++){
	    //System.out.println(i + " " + dp[i]);
	    max = Math.max(max, dp[i]);
	}
	out.println(Math.min(max,r)-l);
        out.close();
    }

    public static void main(String args[]) throws Exception{
	new Main().run();
    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

    static StringTokenizer st;
    static BufferedReader br;
    static PrintWriter pw;
    static double[]sin, cos;
    static double s;
    static int xx, yy, ii;
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        int L = nextInt();
        int R = nextInt();
        double[]dp = new double[1 << n];
        Arrays.fill(dp, L);
        int[]x = new int[n], y = new int[n];
        double[]a = new double[n];
        sin = new double[n];
        cos = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = nextInt();
            y[i] = nextInt();
            a[i] = nextDouble();
            sin[i] = Math.sin(Math.toRadians(a[i]));
            cos[i] = Math.cos(Math.toRadians(a[i]));
        }
        for (int i = 0; i < n; i++) {
            dp[1 << i] = calc(L, x[i], y[i], i);
        }
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                if ((mask & (1 << i)) != 0) {
                    dp[mask] = Math.max(dp[mask], calc(dp[mask ^ (1 << i)], x[i], y[i], i));
                }
            }
        }
        double max = L;
        for (int mask = 0; mask < (1 << n); mask++) {
            max = Math.max(max, dp[mask]);
        }
        if (max > R)
            max = R;
        pw.println(max-L);
        pw.close();
    }
    private static double calc(double s, int x, int y, int i) {
        double d = Math.sqrt((x-s)*(x-s)+y*y);
        double sinalfa = y / d;
        double cosalfa = (x-s) / d;
        double q = sin[i]*cosalfa+cos[i]*sinalfa;
        if (q < 0)
            return 1e9;
        double r = d * sin[i] / q;
        return s+r;
    }
    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
    private static String next() throws IOException {
        while (st==null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}
/*
20 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
*/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class R226D2D {
    static class Light{
        int x, y;
        double alpha;
        public Light(int x, int y, int a){
            this.x = x;
            this.y = y;
            this.alpha = Math.PI*a/180;
        }
        public double stretch(double start, double max){
            double beta = Math.atan2(start-this.x, this.y);
            if(this.alpha+beta>=Math.PI/2) return max;
            double uncovered = Math.tan(this.alpha+beta)*this.y;
            return x-start+uncovered;
        }
    }

    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        double start = Integer.parseInt(st.nextToken());
        double end = Integer.parseInt(st.nextToken());
        Light[] lights = new Light[n];
        for(int i=0; i<n; i++){
            st = new StringTokenizer(br.readLine());
            lights[i] = new Light(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()));
        }
        double[] dp = new double[1<<n];
        for(int i=1; i<(1<<n); i++){
            for(int pos=0; pos<n; pos++){
                if((i&(1<<pos))>0){
                    int j = i - (1<<pos);
                    dp[i] = Math.max(dp[i], dp[j]+lights[pos].stretch(start+dp[j], end-start));
                }
            }
        }
        System.out.println(Math.min(end-start, dp[(1<<n)-1]));
    }

}

import java.io.*;
import java.util.*;
public class c {
public static void main(String[] args) throws IOException {
	input.init(System.in);
	PrintWriter out = new PrintWriter(System.out);
	int n = input.nextInt(), l = input.nextInt(), r = input.nextInt();
	int[] xs = new int[n], ys = new int[n];
	double[] as = new double[n];
	for(int i = 0; i<n; i++)
	{
		xs[i] = input.nextInt();
		ys[i] = input.nextInt();
		as[i] = input.nextDouble() * Math.PI / 180;
	}
	double[] dp = new double[1<<n];
	dp[0] = l;
	Arrays.fill(dp, l);
	for(int i = 0; i<(1<<n); i++)
	{
		//out.println(i+" "+dp[i]);
		for(int j = 0; j<n; j++)
		{
			if((i & (1<<j)) > 0) continue;
			Point p = new Point(xs[j], ys[j]);
			Point at = new Point(dp[i], 0);
			if(Math.abs(ys[j] - dp[i]) < 1e-9 && Math.abs(as[j] - Math.PI/2) < 1e-9)
			{
				dp[i | (1<<j)] = r;
				continue;
			}
			Point vect = at.minus(p).rotate(as[j]);
			//out.println(vect.x+" "+vect.y);
			if(vect.y >= 0)
			{
				dp[i | (1<<j)] = r;
				continue;
			}
			vect = vect.mult(ys[j]/-(vect.y)).plus(p);
			//out.println(vect.x+" "+vect.y);
			dp[i | (1<<j)] = Math.max(dp[i | (1<<j)], Math.min(r, vect.x));
		}
	}
	out.println(dp[(1<<n)-1] - l);
	out.close();
}
static class Point
{
	double x, y;
	public Point(double xx, double yy)
	{
		 x = xx; y = yy;
	}
	Point minus(Point p)
	{
		return new Point(x - p.x, y - p.y);
	}
	Point rotate(double theta)
	{
		double nx = x*Math.cos(theta) - y*Math.sin(theta);
		double ny = x*Math.sin(theta) + y*Math.cos(theta);
		return new Point(nx, ny);
	}
	Point mult(double d)
	{
		return new Point(this.x*d, this.y*d);
	}
	Point plus(Point p)
	{
		return new Point(x+p.x, y+p.y);
	}
}
public static class input {
	static BufferedReader reader;
	static StringTokenizer tokenizer;

	static void init(InputStream input) {
		reader = new BufferedReader(new InputStreamReader(input));
		tokenizer = new StringTokenizer("");
	}

	static String next() throws IOException {
		while (!tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(reader.readLine());
		return tokenizer.nextToken();
	}

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

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

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}
}
}

import java.util.Scanner;

public class Main {

    static double sin[] = new double[91];
    static double cos[] = new double[91];

    static {
        for(int i = 0; i <= 90; ++i){
            sin[i] = Math.sin(Math.PI * i / 180);
            cos[i] = Math.cos(Math.PI * i / 180);
        }
    }

    static class Point{
        final int x;
        final int y;
        final int a;

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

    public static void main(String[] args) {
        System.out.print(new Main().solve());
    }

    int n;
    int l;
    int r;
    Point[] points;

    public double nextEdge(double start, int index){
        Point point = points[index];
        double x1 = start - point.x;
        double y1 = - point.y;

        double y2 = x1 * sin[point.a] + y1 * cos[point.a];
        if (y2 >= 0){
            return r;
        }
        double x2 = x1 * cos[point.a] - y1 * sin[point.a];
        return point.x - x2 * point.y / y2;
    }

    public double solve() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        l = sc.nextInt();
        r = sc.nextInt();
        points = new Point[n];
        for(int i = 0; i < n; ++i){
            points[i] = new Point(
                    sc.nextInt(),
                    sc.nextInt(),
                    sc.nextInt());
        }
        double[] distance = new double[1<<21];
        for(int i = 0; i < distance.length; ++i){
            distance[i] = l - 1;
        }
        int[] visited = new int[1<<21];
        int count = 0;
        visited[count++] = 0;
        distance[0] = l;
        int start = 0;

        for(int c = 1; c <= n; ++c){
            int end = count;
            for(int i = start; i < end; ++i){
                int value = visited[i];
                for(int b = 0; b < n; ++b){
                    int mask = 1 << b;
                    if((value & mask) != 0) continue;
                    int cur = value | mask;
                    if(distance[cur] == l - 1)visited[count++] = cur;
                    double next = nextEdge(distance[value], b);
                    if(next >= r) return r - l;
                    if(next > distance[cur]) distance[cur] = next;
                }
            }
            start = end;
        }
        return distance[count - 1] - l;
    }
}

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author sheep
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    private static final double PI = Math.PI;
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        double l = in.nextInt();
        double r = in.nextInt();
        int[] x = new int[n];
        int[] y = new int[n];
        double[] a = new double[n];
        for (int i = 0; i < n; ++i) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
            a[i] = in.nextInt() / 180.0 * PI;
        }
        double[] dp = new double[1 << n];
        Arrays.fill(dp, l);
        for (int mask = 0; mask < (1 << n); ++mask) {
            for (int i = 0; i < n; ++i) {
                if ((mask >> i) % 2 == 1) continue;
                double x1 = dp[mask] - x[i];
                double y1 = -y[i];
                double angle = Math.atan2(y1, x1);
                if (angle + a[i] > -FloatPoint.eps) {
                    out.printf("%.10f\n", r - l);
                    return;
                }
                angle += a[i];
                double to = y[i] * Math.tan(PI * 0.5 + angle) + x[i];
                if (to >= r - FloatPoint.eps) {
                    out.printf("%.10f\n", r - l);
                    return;
                }
                dp[mask | (1 << i)] = Math.max(dp[mask | (1 << i)], to);
            }
        }

        out.printf("%.10f\n", dp[(1 << n) - 1] - l);
    }
}

class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e) {
                throw new UnknownError();
            }
        }
        return tokenizer.nextToken();
    }

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

    }

class FloatPoint implements Comparable<FloatPoint>, Point, Cloneable {

    public static double eps = 1e-10;

    public double x, y;

    public static int signum(double value) {
        return value > eps ? 1 : value < -eps ? -1 : 0;
    }

    public FloatPoint(double x, double y) {
        this.x = x;
        this.y = y;
    }

    public double det(FloatPoint o) {
        return x * o.y - y * o.x;
    }

    public int compareTo(FloatPoint point) {
        return signum(det(point));
    }

    public String toString() {
        return "[" + x + ", " + y + "]";
    }

    public FloatPoint clone() {
        return new FloatPoint(x, y);
    }

    }

interface Point {
    }

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(final String[] args) throws IOException {
        try(Scanner scan = new Scanner(System.in);
            PrintWriter print = new PrintWriter(System.out)) {
            final int n = scan.nextInt();
            final int l = scan.nextInt();
            final int r = scan.nextInt();
            final Floodlight[] floodlights = new Floodlight[n];
            for(int i = 0; i < n; ++i) {
                final int x = scan.nextInt();
                final int y = scan.nextInt();
                final double angle = scan.nextInt() / 180. * Math.PI;
                floodlights[i] = new Floodlight(x, y, angle);
            }
            print.println(calcMaxBeginSeg(l, r, floodlights));
        }
    }

    public static double calcMaxBeginSeg(final int left, final int right, final Floodlight[] floodlights) {
        if(right <= left) return 0.;
        final int n = floodlights.length;
        double maxLitRight[] = new double[1 << n];
        maxLitRight[0] = left;
        for(int mask = 1; mask < 1 << n; ++mask) {
            double result = left;
            for(int i = 0; i < n; ++i) {
                if(((mask >> i) & 1) == 1) {
                    result = Math.max(result, extendLitSeg(maxLitRight[mask ^ (1 << i)], floodlights[i], right));
                }
            }
            maxLitRight[mask] = result;
        }
        return maxLitRight[(1 << n) - 1] - left;
    }

    private static double extendLitSeg(final double left, final Floodlight light, final double maxRight) {
        if(left >= maxRight) return left;
        if(light.y <= 0.) throw new RuntimeException("light.y must be > 0");
        final double startAngle = Math.atan((left - light.getX()) / light.getY());
        final double endAngle = startAngle + light.angle;
        if(endAngle >= Math.PI / 2.) return maxRight;
        return Math.min(maxRight, light.getX() + light.getY() * Math.tan(endAngle));
    }

    public static class Floodlight {
        private final int x;
        private final int y;
        private final double angle;

        public Floodlight(final int x, final int y, final double angle) {
            this.x = x;
            this.y = y;
            this.angle = angle;
        }

        public int getX() {
            return x;
        }

        public int getY() {
            return y;
        }

        public double getAngle() {
            return angle;
        }
    }

    public static class NumberUtils {
        public static interface Factorizer {
            List<Integer> factorize(int number);
        }

        /**
         * thread safe Factorizer
         */
        public static Factorizer createSmallNumberFactorizer(final int upperBound) {
            return new SmallNumberFactorizer(upperBound);
        }

        /**
         * thread safe
         */
        private static class SmallNumberFactorizer implements Factorizer {
            private int[] divisors;
            private final int upperBound;
            private boolean prepared = false;

            /**
             * lazy
             * time complexity O(n * log(n) * log(log(n))
             * memory complexity O(n)
             */
            public SmallNumberFactorizer(final int upperBound) {
                this.upperBound = upperBound;
            }

            private synchronized void prepare() {
                divisors = new int[upperBound];
                Arrays.fill(divisors, 0);
                for(int i = 2; i * i < upperBound; ++i) {
                    if(divisors[i] == 0) {
                        for(int j = i * i; j < upperBound; j += i) {
                            if(divisors[j] == 0) {
                                divisors[j] = i;
                            }
                        }
                    }
                }
                prepared = true;
            }

            /**
             * complexity O(result)
             */
            public List<Integer> factorize(int number) {
                synchronized (this) {
                    if(!prepared) {
                        prepare();
                    }
                }
                final List<Integer> result = CollectionFactory.createArrayList();
                if(number < 2) return result;
                if(number >= upperBound) throw new RuntimeException("number should be less than upper bound");
                while(divisors[number] > 0) {
                    result.add(divisors[number]);
                    number /= divisors[number];
                }
                result.add(number);
                return result;
            }
        }
    }

    public static class CollectionFactory {
        public static<T> List<T> createArrayList() {
            return new ArrayList<>();
        }

        public static<T> List<T> createArrayList(final int capacity) {
            return new ArrayList<>(capacity);
        }
    }

    public static class CollectionUtils {
        public static<T> List<T> unique(final List<T> list) {
            final List<T> result = CollectionFactory.createArrayList();
            T p = null;
            for(T elem : list) {
                if(!elem.equals(p)) {
                    result.add(elem);
                    p = elem;
                }
            }
            return result;
        }

        public static<T extends Comparable<T>> T max(final List<T> list, final T lowerBound) {
            T result = lowerBound;
            for(T elem : list) {
                if(elem.compareTo(result) > 0) {
                    result = elem;
                }
            }
            return result;
        }
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ProblemD {

	static final double EPS = 1e-11;

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		String[] nlr = in.readLine().split(" ");
		int n = Integer.valueOf(nlr[0]);
		int l = Integer.valueOf(nlr[1]);
		int r = Integer.valueOf(nlr[2]);

		long[][] light = new long[n][2];
		double[] rad = new double[n];
		for (int i = 0 ; i < n ; i++) {
			String[] xya = in.readLine().split(" ");
			light[i][0] = Integer.valueOf(xya[0]);
			light[i][1] = Integer.valueOf(xya[1]);
			int ra = Integer.valueOf(xya[2]);
			rad[i] = Math.PI * ra / 180;
		}

		double[] dp = new double[1<<n];
		double best = l;
		Arrays.fill(dp, -1e12);
		dp[0] = l;
		for (int i = 0 ; i < (1<<n) ; i++) {
			if (dp[i] + EPS >= l) {
				double left = dp[i];
				for (int j = 0 ; j < n ; j++) {
					if ((i & (1<<j)) >= 1) {
						continue;
					}
					int ti = i|(1<<j);
					double dx = (left - light[j][0]);
					double dy = -light[j][1];
					{
						double tdx = dx * Math.cos(rad[j]) - dy * Math.sin(rad[j]);
						double tdy = dx * Math.sin(rad[j]) + dy * Math.cos(rad[j]);
						if (tdy >= -EPS) {
							best = r;
						} else {
							double tdxOne = tdx * light[j][1] / (Math.abs(tdy) + EPS);
							double tx = light[j][0] + tdxOne;
							if (dp[ti] < tx) {
								dp[ti] = tx;
								best = Math.max(best, dp[ti]);
							}
						}
					}
				}
			}
			if (best > r) {
				break;
			}
		}

		out.println(Math.min(r - l, best - l));
		out.flush();
	}

	static double[] rotate(double dx, double dy, double rad) {
		return new double[]{ dx * Math.cos(rad) - dy * Math.sin(rad), dx * Math.sin(rad) + dy * Math.cos(rad)};
	}

	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}

}

import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		InputReader in = new InputReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		new Task().go(in, out);
		out.close();
	}

}

class Task {
	public static final int N = 22, MOD = (int) (1e9 + 7);
	public static final double eps = 1e-11;
	double[] sin = new double[N];
	double[] cos = new double[N];
	double[] dp = new double[1<<20];
	int[] x = new int[N];
	int[] y = new int[N];
	int n, l, r;
	public void go(InputReader in, PrintWriter out) {
		n = in.nextInt();
		l = in.nextInt();
		r = in.nextInt();
		for(int i = 0; i < n; i++) {
			x[i] = in.nextInt();
			y[i] = in.nextInt();
			double a = in.nextDouble();
			sin[i] = Math.sin(Math.toRadians(a));
			cos[i] = Math.cos(Math.toRadians(a));
		}

		Arrays.fill(dp, l);
		for(int i = 0; i < n; i++) dp[1<<i] = cal(l, x[i], y[i], i);
		for(int i = 0; i < (1<<n); i++) {
			for(int j = 0; j < n; j++) {
				if((i & (1<<j)) != 0) {
					dp[i] = Math.max(dp[i], cal(dp[i - (1<<j)], x[j], y[j], j));
				}
			}
		}
		double max = l;
		for(int i = 1; i < (1<<n); i++) max = Math.max(max, dp[i]);
		max = Math.min(max, r) - l;
		out.printf("%.8f\n", max);
	}

	public double cal(double lef, int x, int y, int id) {
		double dis = Math.sqrt((x - lef) * (x - lef) + (double) y * y);
		double C = (x - lef) / dis;
		double S = y / dis;
		double q = sin[id] * C + cos[id] * S;
		if(q < eps) return 1e9;
		return sin[id] * dis / q + lef;
	}
}

class InputReader {
	BufferedReader bf;
	StringTokenizer st;

	InputReader(InputStreamReader is) {
		bf = new BufferedReader(is);
	}

	public String next() {
		if (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(bf.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

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

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

//package round226;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class D {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int n = ni(), L = ni(), R = ni();
		int[][] light = new int[n][];
		for(int i = 0;i < n;i++){
			light[i] = new int[]{ni() ,ni(), ni()};
		}

		double[] dp = new double[1<<n];
		dp[0] = L;
		for(int i = 1;i < 1<<n;i++){
			double max = L;
			for(int j = 0;j < n;j++){
				if(i<<31-j<0){
					double sx = dp[i^1<<j];
					double theta = Math.atan2(0-light[j][1], sx-light[j][0]);
					if(theta + light[j][2]*Math.PI/180 >= 0){
						out.println(R-L);
						return;
					}
					double nx = light[j][0] - light[j][1]/Math.tan(theta+light[j][2]*Math.PI/180);
					if(nx >= R){
						out.println(R-L);
						return;
					}
					max = Math.max(max, nx);
				}
			}
			dp[i] = max;
		}
		out.printf("%.15f\n", dp[(1<<n)-1]-L);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new D().run(); }

	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
                int n = in.nextInt();
                int L = in.nextInt();
                int R = in.nextInt();
                int[] x = new int[n];
                int[] y = new int[n];
                double a[] = new double[n];
                for (int i = 0; i < n; i++) {
                        x[i] = in.nextInt();
                        y[i] = in.nextInt();
                        a[i] = in.nextInt();
                        a[i] /= 180.0;
                        a[i] *= Math.PI;
                }
                double dp[] = new double[1 << n];
                Arrays.fill(dp, L);
                for (int mask = 0; mask < (1 << n); mask++)
                        for (int i = 0; i < n; i++) {
                                if ((mask & (1 << i)) != 0)
                                        continue;
                                double newX = getNewX(x[i], y[i], a[i], dp[mask]);
                                dp[mask | (1 << i)] = Math.max(dp[mask | (1 << i)], newX);
                        }
                out.format("%.9f", Math.min(dp[(1 << n) - 1] - L, (double)R - L));
        }

        double getNewX(int x0, int y0, double angle, double oldX) {
                double dx = oldX - x0;
                double alpha = Math.atan(dx / y0);
                double beta = alpha + angle;
                if (beta > Math.PI / 2.0 - 1e-9)
                        return 1e9;
                return Math.tan(beta) * y0 + x0;
        }
}

class FastScanner {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public FastScanner(InputStream inputStream)  {
                reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String nextToken() {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                        String line;
                        try {
                                line = reader.readLine();
                        } catch (IOException e) {
                                return null;
                        }
                        tokenizer = new StringTokenizer(line);
                }
                return tokenizer.nextToken();
        }

        public int nextInt() {
                return Integer.parseInt(nextToken());
        }

        }

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main
{
	/********************************************** a list of common variables **********************************************/

	private MyScanner scan = new MyScanner();
	private PrintWriter out = new PrintWriter(System.out);
	private final double PI = Math.acos(-1.0);
	private final int SIZEN = (int)(1e7);
	private final int MOD = (int)(1e9 + 7);

	public double getNext(double p, int x, int y, double a, int right)
	{
		double theta = Math.atan((double)(p - x) / y) + a;
		return x + Math.tan(Math.min(theta, Math.atan((double)(right - x) / y))) * y;
	}

	public void foo()
	{
		int n = scan.nextInt();
		int left = scan.nextInt();
		int right = scan.nextInt() - left;
		int[] x = new int[n];
		int[] y = new int[n];
		int[] a = new int[n];
		for(int i = 0;i < n;++i)
		{
			x[i] = scan.nextInt() - left;
			y[i] = scan.nextInt();
			a[i] = scan.nextInt();
		}
		double[] dp = new double[1 << n];
	//	dp[0] = left;
		for(int i = 0;i < (1 << n);++i)
		{
			for(int j = 0;j < n;++j)
			{
				if(0 == (i & (1 << j)))
				{
					double pNext = getNext(dp[i], x[j], y[j], a[j] / 180.0 * PI, right);
					if(pNext == Double.MAX_VALUE / 2)
					{
						out.println("***" + i + " " + j + " " + dp[i]);
					}
					dp[i | (1 << j)] = Math.max(dp[i | (1 << j)], pNext);
				}
			}
		}
		out.println(dp[(1 << n) - 1]);
	}

	public static void main(String[] args)
	{
		Main m = new Main();
		m.foo();
		m.out.close();
	}

	/********************************************** a list of common algorithms **********************************************/

	/**
	 * KMP match, i.e. kmpMatch("abcd", "bcd") = 1, kmpMatch("abcd", "bfcd") = -1.
	 *
	 * @param t: String to match.
	 * @param p: String to be matched.
	 * @return if can match, first index; otherwise -1.
	 */
	public int kmpMatch(char[] t, char[] p)
	{
		int n = t.length;
		int m = p.length;
		int[] next = new int[m + 1];
		next[0] = -1;
		int j = -1;
		for(int i = 1;i < m;++i)
		{
			while(j >= 0 && p[i] != p[j + 1])
			{
				j = next[j];
			}
			if(p[i] == p[j + 1])
			{
				++j;
			}
			next[i] = j;
		}
		j = -1;
		for(int i = 0;i < n;++i)
		{
			while(j >= 0 && t[i] != p[j + 1])
			{
				j = next[j];
			}
			if(t[i] == p[j + 1])
			{
				++j;
			}
			if(j == m - 1)
			{
				return i - m + 1;
			}
		}
		return -1;
	}

	class MyScanner
	{
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    BufferedInputStream bis = new BufferedInputStream(System.in);

	    public int read()
	    {
	        if (-1 == numChars)
	        {
	        	throw new InputMismatchException();
	        }
	        if (curChar >= numChars)
	        {
	            curChar = 0;
	            try
	            {
	                numChars = bis.read(buf);
	            }
	            catch (IOException e)
	            {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	            {
	            	return -1;
	            }
	        }
	        return buf[curChar++];
	    }

	    public int nextInt()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do
	        {
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong()
	    {
	    	int c = read();
	    	while (isSpaceChar(c))
	    	{
	    		c = read();
	    	}
	    	int sgn = 1;
	    	if (c == '-')
	    	{
	    		sgn = -1;
	    		c = read();
	    	}
	    	long res = 0;
	    	do
	    	{
	    		if (c < '0' || c > '9')
	    		{
	    			throw new InputMismatchException();
	    		}
	    		res *= 10;
	    		res += c - '0';
	    		c = read();
	    	} while (!isSpaceChar(c));
	    	return res * sgn;
	    }

	    public double nextDouble()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        double res = 0;
	        while (!isSpaceChar(c) && c != '.')
	        {
	            if (c == 'e' || c == 'E')
	            {
	            	return res * Math.pow(10, nextInt());
	            }
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c & 15;
	            c = read();
	        }
	        if (c == '.')
	        {
	            c = read();
	            double m = 1;
	            while (!isSpaceChar(c))
	            {
	                if (c == 'e' || c == 'E')
	                {
	                	return res * Math.pow(10, nextInt());
	                }
	                if (c < '0' || c > '9')
	                {
	                	throw new InputMismatchException();
	                }
	                m /= 10;
	                res += (c & 15) * m;
	                c = read();
	            }
	        }
	        return res * sgn;
	    }

	    public String next()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        StringBuilder res = new StringBuilder();
	        do
	        {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    private boolean isSpaceChar(int c)
	    {
	        return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
	    }
	}
}

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main
{
	/********************************************** a list of common variables **********************************************/

	private MyScanner scan = new MyScanner();
	private PrintWriter out = new PrintWriter(System.out);
	private final double PI = Math.acos(-1.0);
	private final int SIZEN = (int)(1e7);
	private final int MOD = (int)(1e9 + 7);

	public double getNext(double p, double x, double y, double a, double right)
	{
		double theta = Math.atan((double)(p - x) / y) + a;
		theta = Math.min(theta, Math.atan((double)(right - x) / y));
		return x + Math.tan(theta) * y;
	}

	public void foo()
	{
		int n = scan.nextInt();
		double left = scan.nextDouble();
		double right = scan.nextDouble() - left;
		double[] x = new double[n];
		double[] y = new double[n];
		double[] a = new double[n];
		for(int i = 0;i < n;++i)
		{
			x[i] = scan.nextDouble() - left;
			y[i] = scan.nextDouble();
			a[i] = Math.toRadians(scan.nextDouble());
		}
		double[] dp = new double[1 << n];
		for(int i = 0;i < (1 << n);++i)
		{
			for(int j = 0;j < n;++j)
			{
				if(0 == (i & (1 << j)))
				{
					dp[i | (1 << j)] = Math.max(dp[i | (1 << j)], getNext(dp[i], x[j], y[j], a[j], right));
				}
			}
		}
		out.println(dp[(1 << n) - 1]);
	}

	public static void main(String[] args)
	{
		Main m = new Main();
		m.foo();
		m.out.close();
	}

	/********************************************** a list of common algorithms **********************************************/

	/**
	 * KMP match, i.e. kmpMatch("abcd", "bcd") = 1, kmpMatch("abcd", "bfcd") = -1.
	 *
	 * @param t: String to match.
	 * @param p: String to be matched.
	 * @return if can match, first index; otherwise -1.
	 */
	public int kmpMatch(char[] t, char[] p)
	{
		int n = t.length;
		int m = p.length;
		int[] next = new int[m + 1];
		next[0] = -1;
		int j = -1;
		for(int i = 1;i < m;++i)
		{
			while(j >= 0 && p[i] != p[j + 1])
			{
				j = next[j];
			}
			if(p[i] == p[j + 1])
			{
				++j;
			}
			next[i] = j;
		}
		j = -1;
		for(int i = 0;i < n;++i)
		{
			while(j >= 0 && t[i] != p[j + 1])
			{
				j = next[j];
			}
			if(t[i] == p[j + 1])
			{
				++j;
			}
			if(j == m - 1)
			{
				return i - m + 1;
			}
		}
		return -1;
	}

	class MyScanner
	{
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    BufferedInputStream bis = new BufferedInputStream(System.in);

	    public int read()
	    {
	        if (-1 == numChars)
	        {
	        	throw new InputMismatchException();
	        }
	        if (curChar >= numChars)
	        {
	            curChar = 0;
	            try
	            {
	                numChars = bis.read(buf);
	            }
	            catch (IOException e)
	            {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	            {
	            	return -1;
	            }
	        }
	        return buf[curChar++];
	    }

	    public int nextInt()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do
	        {
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong()
	    {
	    	int c = read();
	    	while (isSpaceChar(c))
	    	{
	    		c = read();
	    	}
	    	int sgn = 1;
	    	if (c == '-')
	    	{
	    		sgn = -1;
	    		c = read();
	    	}
	    	long res = 0;
	    	do
	    	{
	    		if (c < '0' || c > '9')
	    		{
	    			throw new InputMismatchException();
	    		}
	    		res *= 10;
	    		res += c - '0';
	    		c = read();
	    	} while (!isSpaceChar(c));
	    	return res * sgn;
	    }

	    public double nextDouble()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        double res = 0;
	        while (!isSpaceChar(c) && c != '.')
	        {
	            if (c == 'e' || c == 'E')
	            {
	            	return res * Math.pow(10, nextInt());
	            }
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c & 15;
	            c = read();
	        }
	        if (c == '.')
	        {
	            c = read();
	            double m = 1;
	            while (!isSpaceChar(c))
	            {
	                if (c == 'e' || c == 'E')
	                {
	                	return res * Math.pow(10, nextInt());
	                }
	                if (c < '0' || c > '9')
	                {
	                	throw new InputMismatchException();
	                }
	                m /= 10;
	                res += (c & 15) * m;
	                c = read();
	            }
	        }
	        return res * sgn;
	    }

	    public String next()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        StringBuilder res = new StringBuilder();
	        do
	        {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    private boolean isSpaceChar(int c)
	    {
	        return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
	    }
	}
}

import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Árysson Cavalcanti
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskD {

    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n=in.readInt(), l=in.readInt(), r=in.readInt();
        double[] a=new double[n];
        Point[] point=new Point[n];
        for (int i=0; i<n; i++) {
            point[i]=Point.readPoint(in);
            a[i]= Math.PI*in.readInt()/180;
        }
        double[] dp=new double[1<<n];
        dp[0]=l;
        Line horizontal=new Line(Point.ORIGIN, 0);
        for (int mask=0; mask<(1<<n); mask++) {
            dp[mask]=Double.MIN_VALUE;
            for (int i=0; i<n; i++) if ((mask&(1<<i))>0) {
                Point p0=point[i];
                Point p1=new Point(dp[mask^(1<<i)], 0), p2=(new Point(p1.x-p0.x, p1.x-p0.y)).rotate(a[i]);
                //p2=new Point(p2.x+p0.x, p2.y+p0.y);
                //Point p3=p0.line(p2).intersect(horizontal);
                double x;
                if (p2.y>-GeometryUtils.epsilon) x=r;
                else x=MiscUtils.min(1.0*r, p0.x-p0.y/p2.y*p2.x);
                dp[mask]=MiscUtils.max(dp[mask], x);
            }
        }
        out.printLine(dp[(1<<n)-1]-l);
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class Point {
    public static final Point ORIGIN = new Point(0, 0);
    public final double x;
    public final double y;

    public String toString() {
        return "(" + x + ", " + y + ")";
    }

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

    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Point point = (Point) o;

        return Math.abs(x - point.x) <= GeometryUtils.epsilon && Math.abs(y - point.y) <= GeometryUtils.epsilon;
    }

    public int hashCode() {
        int result;
        long temp;
        temp = x != +0.0d ? Double.doubleToLongBits(x) : 0L;
        result = (int) (temp ^ (temp >>> 32));
        temp = y != +0.0d ? Double.doubleToLongBits(y) : 0L;
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        return result;
    }

    public static Point readPoint(InputReader in) {
        double x = in.readDouble();
        double y = in.readDouble();
        return new Point(x, y);
    }

    public Point rotate(double angle) {
        double nx = x * Math.cos(angle) - y * Math.sin(angle);
        double ny = y * Math.cos(angle) + x * Math.sin(angle);
        return new Point(nx, ny);
    }
}

class Line {
    public final double a;
    public final double b;
    public final double c;

    public Line(Point p, double angle) {
        a = Math.sin(angle);
        b = -Math.cos(angle);
        c = -p.x * a - p.y * b;
    }

    public boolean parallel(Line other) {
        return Math.abs(a * other.b - b * other.a) < GeometryUtils.epsilon;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Line line = (Line) o;

        if (!parallel(line)) return false;
        if (Math.abs(a * line.c - c * line.a) > GeometryUtils.epsilon || Math.abs(b * line.c - c * line.b) > GeometryUtils.epsilon) return false;

        return true;
    }
}

class GeometryUtils {
    public static double epsilon = 1e-8;

}

class MiscUtils {

    public static<T extends Comparable<T>> T min(T first, T second) {
        if (first.compareTo(second) <= 0)
            return first;
        return second;
    }

    public static<T extends Comparable<T>> T max(T first, T second) {
        if (first.compareTo(second) <= 0)
            return second;
        return first;
    }

}

import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Árysson Cavalcanti
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskD {

    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n=in.readInt(), l=in.readInt(), r=in.readInt();
        double[] a=new double[n];
        Point[] point=new Point[n];
        for (int i=0; i<n; i++) {
            point[i]=Point.readPoint(in);
            a[i]= Math.PI*in.readInt()/180;
        }
        double[] dp=new double[1<<n];
        dp[0]=l;
        Line horizontal=new Line(Point.ORIGIN, 0);
        for (int mask=0; mask<(1<<n); mask++) {
            dp[mask]=Double.MIN_VALUE;
            for (int i=0; i<n; i++) if ((mask&(1<<i))>0) {
                Point p0=point[i], p1=new Point(dp[mask^(1<<i)], 0), p2=(new Point(p1.x-p0.x, p1.x-p0.y)).rotate(a[i]);
                p2=new Point(p2.x+p0.x, p2.y+p0.y);
                Point p3=p0.line(p2).intersect(horizontal);
                double x;
                if (p3==null || p3.x-dp[mask^(1<<i)]<-GeometryUtils.epsilon) x=r;
                else x=MiscUtils.min(1.0*r, p3.x);
                dp[mask]=MiscUtils.max(dp[mask], x);
            }
        }
        out.printLine(dp[(1<<n)-1]-l);
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class Point {
    public static final Point ORIGIN = new Point(0, 0);
    public final double x;
    public final double y;

    public String toString() {
        return "(" + x + ", " + y + ")";
    }

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

    public Line line(Point other) {
        if (equals(other))
            return null;
        double a = other.y - y;
        double b = x - other.x;
        double c = -a * x - b * y;
        return new Line(a, b, c);
    }

    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Point point = (Point) o;

        return Math.abs(x - point.x) <= GeometryUtils.epsilon && Math.abs(y - point.y) <= GeometryUtils.epsilon;
    }

    public int hashCode() {
        int result;
        long temp;
        temp = x != +0.0d ? Double.doubleToLongBits(x) : 0L;
        result = (int) (temp ^ (temp >>> 32));
        temp = y != +0.0d ? Double.doubleToLongBits(y) : 0L;
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        return result;
    }

    public static Point readPoint(InputReader in) {
        double x = in.readDouble();
        double y = in.readDouble();
        return new Point(x, y);
    }

    public Point rotate(double angle) {
        double nx = x * Math.cos(angle) - y * Math.sin(angle);
        double ny = y * Math.cos(angle) + x * Math.sin(angle);
        return new Point(nx, ny);
    }
}

class Line {
    public final double a;
    public final double b;
    public final double c;

    public Line(Point p, double angle) {
        a = Math.sin(angle);
        b = -Math.cos(angle);
        c = -p.x * a - p.y * b;
    }

    public Line(double a, double b, double c) {
        double h = GeometryUtils.fastHypot(a, b);
        this.a = a / h;
        this.b = b / h;
        this.c = c / h;
    }

    public Point intersect(Line other) {
        if (parallel(other))
            return null;
        double determinant = b * other.a - a * other.b;
        double x = (c * other.b - b * other.c) / determinant;
        double y = (a * other.c - c * other.a) / determinant;
        return new Point(x, y);
    }

    public boolean parallel(Line other) {
        return Math.abs(a * other.b - b * other.a) < GeometryUtils.epsilon;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Line line = (Line) o;

        if (!parallel(line)) return false;
        if (Math.abs(a * line.c - c * line.a) > GeometryUtils.epsilon || Math.abs(b * line.c - c * line.b) > GeometryUtils.epsilon) return false;

        return true;
    }
}

class GeometryUtils {
    public static double epsilon = 1e-8;

    public static double fastHypot(double x, double y) {
        return Math.sqrt(x * x + y * y);
    }

}

class MiscUtils {

    public static<T extends Comparable<T>> T min(T first, T second) {
        if (first.compareTo(second) <= 0)
            return first;
        return second;
    }

    public static<T extends Comparable<T>> T max(T first, T second) {
        if (first.compareTo(second) <= 0)
            return second;
        return first;
    }

}

import java.util.Scanner;

public class D {
    public static double calc(double x, double y, double a, double p) {
        double d = Math.abs(x - p);
        double h = Math.sqrt(y * y + d * d);
        double B = Math.asin(d / h);
        double b = B - a * Math.PI / 180;
        double c = Math.PI - b - Math.PI / 2;
        double dis = y * Math.sin(b) / Math.sin(c);
        return d - dis;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        double l = in.nextDouble();
        double r = in.nextDouble();
        double[] x = new double[n];
        double[] y = new double[n];
        double[] a = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.nextDouble();
            y[i] = in.nextDouble();
            a[i] = in.nextDouble();
        }
        boolean[] visited = new boolean[n];
        double current = l;
        for (int i = 0; i < n; i++) {
            double largest = 0;
            int index = -1;
            for (int j = 0; j < n; j++)
                if (!visited[j]) {
                    double temp = calc(x[j], y[j], a[j], current);
                    if (temp > largest) {
                        index = j;
                        largest = temp;
                    }
                }
            current += largest;
            visited[index] = true;
        }
        System.out.println(Math.min(r, current) - l);
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class D {
    public static double calc(double x, double y, double a, double p) {
        double d = Math.abs(x - p);
        double h = Math.sqrt(y * y + d * d);
        double B = Math.asin(d / h);
        double b = B - a * Math.PI / 180;
        double c = Math.PI - b - Math.PI / 2;
        double dis = y * Math.sin(b) / Math.sin(c);
        return d - dis;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        double l = in.nextDouble();
        double r = in.nextDouble();
        double[] x = new double[n];
        double[] y = new double[n];
        double[] a = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.nextDouble();
            y[i] = in.nextDouble();
            a[i] = in.nextDouble();
        }
        double[] dp = new double[1 << n];
        Arrays.fill(dp, Integer.MIN_VALUE);
        dp[0] = l;
        for (int i = 1; i < (1 << n); i++)
            for (int j = 0; j < n; j++)
                if ((i & (1 << j)) != 0)
                    dp[i] = Math.max(
                            dp[i],
                            dp[i ^ (1 << j)]
                                    + calc(x[j], y[j], a[j], dp[i ^ (1 << j)]));
        System.out.println(Math.min(dp[(1 << n) - 1], r) - l);
    }
}

import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.DataInputStream;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.InputMismatchException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	static class TaskAdapter implements Runnable {
		@Override
		public void run() {
			long startTime = System.currentTimeMillis();
			InputStream inputStream = System.in;
			OutputStream outputStream = System.out;
			FastReader in = new FastReader(inputStream);
			Output out = new Output(outputStream);
			DBearAndFloodlight solver = new DBearAndFloodlight();
			solver.solve(1, in, out);
			out.close();
			System.err.println(System.currentTimeMillis()-startTime+"ms");
		}
	}

	public static void main(String[] args) throws Exception {
		Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28);
		thread.start();
		thread.join();
	}

	static class DBearAndFloodlight {
		double r;

		public DBearAndFloodlight() {
		}

		private double angle(double x, double y, double xx) {
			return Math.atan2(xx-x, y);
		}

		private double dist(double x, double y, double deg, double xx) {
			double ang1 = angle(x, y, xx)+deg, ang2 = angle(x, y, r);
			if(ang1>ang2+0.05) {
				return r;
			}
			return Math.max(x+Math.tan(ang1)*y, xx);
		}

		public void solve(int kase, InputReader in, Output pw) {
			int n = in.nextInt();
			double l = in.nextInt();
			r = in.nextInt()-l;
			double[][] arr = new double[n][3];
			for(int i = 0; i<n; i++) {
				arr[i] = new double[] {in.nextInt()-l, in.nextInt(), Math.toRadians(in.nextInt())};
			}
			Utilities.Debug.dbg(dist(1, 1, 0.5235987755982988, 0));
			double[] dp = new double[1<<n];
			for(int i = 1; i<1<<n; i++) {
				for(int j = 0; j<n; j++) {
					if((1&1<<j)>0) {
						dp[i] = Math.max(dp[i], dist(arr[j][0], arr[j][1], arr[j][2], dp[i^1<<j]));
					}
				}
			}
			Utilities.Debug.dbg(dp);
			pw.printf("%.6f\n", Math.min(r, dp[(1<<n)-1]));
		}

	}

	static class Output implements Closeable, Flushable {
		public StringBuilder sb;
		public OutputStream os;
		public int BUFFER_SIZE;
		public String lineSeparator;

		public Output(OutputStream os) {
			this(os, 1<<16);
		}

		public Output(OutputStream os, int bs) {
			BUFFER_SIZE = bs;
			sb = new StringBuilder(BUFFER_SIZE);
			this.os = new BufferedOutputStream(os, 1<<17);
			lineSeparator = System.lineSeparator();
		}

		public void print(String s) {
			sb.append(s);
			if(sb.length()>BUFFER_SIZE >> 1) {
				flushToBuffer();
			}
		}

		public void printf(String s, Object... o) {
			print(String.format(s, o));
		}

		private void flushToBuffer() {
			try {
				os.write(sb.toString().getBytes());
			}catch(IOException e) {
				e.printStackTrace();
			}
			sb = new StringBuilder(BUFFER_SIZE);
		}

		public void flush() {
			try {
				flushToBuffer();
				os.flush();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

		public void close() {
			flush();
			try {
				os.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

	}

	static interface InputReader {
		int nextInt();

	}

	static class Utilities {
		public static class Debug {
			public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

			private static <T> String ts(T t) {
				if(t==null) {
					return "null";
				}
				try {
					return ts((Iterable) t);
				}catch(ClassCastException e) {
					if(t instanceof int[]) {
						String s = Arrays.toString((int[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof long[]) {
						String s = Arrays.toString((long[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof char[]) {
						String s = Arrays.toString((char[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof double[]) {
						String s = Arrays.toString((double[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof boolean[]) {
						String s = Arrays.toString((boolean[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}
					try {
						return ts((Object[]) t);
					}catch(ClassCastException e1) {
						return t.toString();
					}
				}
			}

			private static <T> String ts(T[] arr) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: arr) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			private static <T> String ts(Iterable<T> iter) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: iter) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			public static void dbg(Object... o) {
				if(LOCAL) {
					System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
					for(int i = 0; i<o.length; i++) {
						if(i!=0) {
							System.err.print(", ");
						}
						System.err.print(ts(o[i]));
					}
					System.err.println("]");
				}
			}

		}

	}

	static class FastReader implements InputReader {
		final private int BUFFER_SIZE = 1<<16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer;
		private int bytesRead;

		public FastReader(InputStream is) {
			din = new DataInputStream(is);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public int nextInt() {
			int ret = 0;
			byte c = skipToDigit();
			boolean neg = (c=='-');
			if(neg) {
				c = read();
			}
			do {
				ret = ret*10+c-'0';
			} while((c = read())>='0'&&c<='9');
			if(neg) {
				return -ret;
			}
			return ret;
		}

		private boolean isDigit(byte b) {
			return b>='0'&&b<='9';
		}

		private byte skipToDigit() {
			byte ret;
			while(!isDigit(ret = read())&&ret!='-') ;
			return ret;
		}

		private void fillBuffer() {
			try {
				bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			}catch(IOException e) {
				e.printStackTrace();
				throw new InputMismatchException();
			}
			if(bytesRead==-1) {
				buffer[0] = -1;
			}
		}

		private byte read() {
			if(bytesRead==-1) {
				throw new InputMismatchException();
			}else if(bufferPointer==bytesRead) {
				fillBuffer();
			}
			return buffer[bufferPointer++];
		}

	}
}

import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.DataInputStream;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.InputMismatchException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	static class TaskAdapter implements Runnable {
		@Override
		public void run() {
			long startTime = System.currentTimeMillis();
			InputStream inputStream = System.in;
			OutputStream outputStream = System.out;
			FastReader in = new FastReader(inputStream);
			Output out = new Output(outputStream);
			DBearAndFloodlight solver = new DBearAndFloodlight();
			solver.solve(1, in, out);
			out.close();
			System.err.println(System.currentTimeMillis()-startTime+"ms");
		}
	}

	public static void main(String[] args) throws Exception {
		Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28);
		thread.start();
		thread.join();
	}

	static class DBearAndFloodlight {
		double r;

		public DBearAndFloodlight() {
		}

		private double angle(double x, double y, double xx) {
			return Math.atan2(xx-x, y);
		}

		private double dist(double x, double y, double deg, double xx) {
			double ang1 = angle(x, y, xx)+deg, ang2 = angle(x, y, r);
			if(ang1>ang2+0.05) {
				return r;
			}
			return Math.max(x+Math.tan(ang1)*y, xx);
		}

		public void solve(int kase, InputReader in, Output pw) {
			int n = in.nextInt();
			double l = in.nextInt();
			r = in.nextInt()-l;
			double[][] arr = new double[n][3];
			for(int i = 0; i<n; i++) {
				arr[i] = new double[] {in.nextInt()-l, in.nextInt(), Math.toRadians(in.nextInt())};
			}
			Utilities.Debug.dbg(dist(1, 1, 0.5235987755982988, 0));
			double[] dp = new double[1<<n];
			for(int i = 1; i<1<<n; i++) {
				for(int j = 0; j<n; j++) {
					if((i&1<<j)>0) {
						dp[i] = Math.max(dp[i], dist(arr[j][0], arr[j][1], arr[j][2], dp[i^1<<j]));
					}
					Utilities.Debug.dbg(j, dp[i]);
				}
			}
			Utilities.Debug.dbg(dp);
			pw.printf("%.6f\n", Math.min(r, dp[(1<<n)-1]));
		}

	}

	static class Output implements Closeable, Flushable {
		public StringBuilder sb;
		public OutputStream os;
		public int BUFFER_SIZE;
		public String lineSeparator;

		public Output(OutputStream os) {
			this(os, 1<<16);
		}

		public Output(OutputStream os, int bs) {
			BUFFER_SIZE = bs;
			sb = new StringBuilder(BUFFER_SIZE);
			this.os = new BufferedOutputStream(os, 1<<17);
			lineSeparator = System.lineSeparator();
		}

		public void print(String s) {
			sb.append(s);
			if(sb.length()>BUFFER_SIZE >> 1) {
				flushToBuffer();
			}
		}

		public void printf(String s, Object... o) {
			print(String.format(s, o));
		}

		private void flushToBuffer() {
			try {
				os.write(sb.toString().getBytes());
			}catch(IOException e) {
				e.printStackTrace();
			}
			sb = new StringBuilder(BUFFER_SIZE);
		}

		public void flush() {
			try {
				flushToBuffer();
				os.flush();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

		public void close() {
			flush();
			try {
				os.close();
			}catch(IOException e) {
				e.printStackTrace();
			}
		}

	}

	static interface InputReader {
		int nextInt();

	}

	static class Utilities {
		public static class Debug {
			public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;

			private static <T> String ts(T t) {
				if(t==null) {
					return "null";
				}
				try {
					return ts((Iterable) t);
				}catch(ClassCastException e) {
					if(t instanceof int[]) {
						String s = Arrays.toString((int[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof long[]) {
						String s = Arrays.toString((long[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof char[]) {
						String s = Arrays.toString((char[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof double[]) {
						String s = Arrays.toString((double[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}else if(t instanceof boolean[]) {
						String s = Arrays.toString((boolean[]) t);
						return "{"+s.substring(1, s.length()-1)+"}";
					}
					try {
						return ts((Object[]) t);
					}catch(ClassCastException e1) {
						return t.toString();
					}
				}
			}

			private static <T> String ts(T[] arr) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: arr) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			private static <T> String ts(Iterable<T> iter) {
				StringBuilder ret = new StringBuilder();
				ret.append("{");
				boolean first = true;
				for(T t: iter) {
					if(!first) {
						ret.append(", ");
					}
					first = false;
					ret.append(ts(t));
				}
				ret.append("}");
				return ret.toString();
			}

			public static void dbg(Object... o) {
				if(LOCAL) {
					System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
					for(int i = 0; i<o.length; i++) {
						if(i!=0) {
							System.err.print(", ");
						}
						System.err.print(ts(o[i]));
					}
					System.err.println("]");
				}
			}

		}

	}

	static class FastReader implements InputReader {
		final private int BUFFER_SIZE = 1<<16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer;
		private int bytesRead;

		public FastReader(InputStream is) {
			din = new DataInputStream(is);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public int nextInt() {
			int ret = 0;
			byte c = skipToDigit();
			boolean neg = (c=='-');
			if(neg) {
				c = read();
			}
			do {
				ret = ret*10+c-'0';
			} while((c = read())>='0'&&c<='9');
			if(neg) {
				return -ret;
			}
			return ret;
		}

		private boolean isDigit(byte b) {
			return b>='0'&&b<='9';
		}

		private byte skipToDigit() {
			byte ret;
			while(!isDigit(ret = read())&&ret!='-') ;
			return ret;
		}

		private void fillBuffer() {
			try {
				bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			}catch(IOException e) {
				e.printStackTrace();
				throw new InputMismatchException();
			}
			if(bytesRead==-1) {
				buffer[0] = -1;
			}
		}

		private byte read() {
			if(bytesRead==-1) {
				throw new InputMismatchException();
			}else if(bufferPointer==bytesRead) {
				fillBuffer();
			}
			return buffer[bufferPointer++];
		}

	}
}

import sun.misc.Compare;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;

import java.math.BigInteger;

import static java.lang.Math.*;
import static java.math.BigInteger.*;
import static java.util.Arrays.*;

public class Main{

    void run(){
        Locale.setDefault(Locale.US);
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
//        boolean oj = true;
        try{
            if( oj ){
                sc  = new FastScanner( new InputStreamReader(System.in  ) );
                out = new PrintWriter(   new OutputStreamWriter(System.out) );
            } else{
                sc  = new FastScanner(new FileReader("in.txt") );
//                sc  = new FastScanner(new FileReader("D:\\JavaOlymp\\FatalError\\output.txt") );
                out = new PrintWriter(   new FileWriter("out.txt") );
            }
        } catch (Exception e) {
            System.exit(-1);
        }
        long tB = System.currentTimeMillis();
        solve();
        if( !oj ) System.err.println( "Time: " + (System.currentTimeMillis()-tB)/1e3 );
        out.flush();
    }

    class FastScanner{
        BufferedReader br;
        StringTokenizer st = new StringTokenizer("");
        FastScanner( InputStreamReader a ){
            br = new BufferedReader(a);
        }
        FastScanner( FileReader a ){
            br = new BufferedReader(a);
        }
        String next(){
            while( !st.hasMoreTokens() )
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    return null;
                }
            return st.nextToken();
        }
        String readLine(){
            try {
                return br.readLine();
            } catch (Exception e) {
                return null;
            }
        }
        int nextInt(){ return Integer.parseInt(next()); }
    }

    FastScanner sc;
    PrintWriter out;

    public static void main(String[] args){
//        new Main().run();
        new Thread( null, new Runnable() {
            @Override
            public void run() {
                new Main().run();
            }
            //}, "LOL", 256L * 1024 * 1024 / 2 ).run();
        }, "LOL", 2000 * 1024 * 1024 ).run();
    }

    void TLE(){ for(;;); }

    void MLE(){
        int[][] adj = new int[1024*1024][];
        for( int i = 0; i < adj.length; ++i )
            adj[i] = new int[1024*1024];
    }

    void exit( int val ){
        out.flush();
        System.exit(val);
    }
    //////////////////////////////////////////////////////////////////////////////////////////

    int n, l, r;
    double[] x, y, cosa, sina, dp;
    final double eps = 1e-9, inf = 1e300;

    double fun( int i, double x1 ){
        double
                dx = x1 - x[i],
                dy = - y[i],
                val = dx * sina[i] + dy * cosa[i];
        if( abs(val) < eps ){
            return r;
        }
        else{
            double k = -y[i] / val;
            double x2 = x[i] + k * ( dx*cosa[i] - dy*sina[i] );
            return x2;
        }
    }

    double f( int msk ){
        if( dp[msk] == inf ){
            dp[msk] = l;
            for( int i = 0; i < n; ++i ){
                if( 0 < (msk&(1<<i)) ){
                    int sub = msk & ~(1<<i);
                    f(sub);
                    dp[msk] = max( dp[msk], fun(i,dp[sub]) );
                    dp[msk] = min( dp[msk], r );
                }
            }
        }
        return dp[msk];
    }

    void solve(){
        n = sc.nextInt();
        l = sc.nextInt();
        r = sc.nextInt();
        x = new double[n];
        y = new double[n];
        cosa = new double[n];
        sina = new double[n];
        for( int i = 0; i < n; ++i ){
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            double alfa = sc.nextInt() * PI / 180;
            cosa[i] = cos(alfa);
            sina[i] = sin(alfa);
        }

        dp = new double[1<<n];
        fill( dp, inf );
        out.printf( "%.10f\n", f((1<<n)-1) - l );
    }

}

import sun.misc.Compare;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;

import java.math.BigInteger;

import static java.lang.Math.*;
import static java.math.BigInteger.*;
import static java.util.Arrays.*;

public class Main{

    void run(){
        Locale.setDefault(Locale.US);
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
//        boolean oj = true;
        try{
            if( oj ){
                sc  = new FastScanner( new InputStreamReader(System.in  ) );
                out = new PrintWriter(   new OutputStreamWriter(System.out) );
            } else{
                sc  = new FastScanner(new FileReader("in.txt") );
//                sc  = new FastScanner(new FileReader("D:\\JavaOlymp\\FatalError\\output.txt") );
                out = new PrintWriter(   new FileWriter("out.txt") );
            }
        } catch (Exception e) {
            System.exit(-1);
        }
        long tB = System.currentTimeMillis();
        solve();
        if( !oj ) System.err.println( "Time: " + (System.currentTimeMillis()-tB)/1e3 );
        out.flush();
    }

    class FastScanner{
        BufferedReader br;
        StringTokenizer st = new StringTokenizer("");
        FastScanner( InputStreamReader a ){
            br = new BufferedReader(a);
        }
        FastScanner( FileReader a ){
            br = new BufferedReader(a);
        }
        String next(){
            while( !st.hasMoreTokens() )
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    return null;
                }
            return st.nextToken();
        }
        String readLine(){
            try {
                return br.readLine();
            } catch (Exception e) {
                return null;
            }
        }
        int nextInt(){ return Integer.parseInt(next()); }
    }

    FastScanner sc;
    PrintWriter out;

    public static void main(String[] args){
//        new Main().run();
        new Thread( null, new Runnable() {
            @Override
            public void run() {
                new Main().run();
            }
            //}, "LOL", 256L * 1024 * 1024 / 2 ).run();
        }, "LOL", 2000 * 1024 * 1024 ).run();
    }

    void TLE(){ for(;;); }

    void MLE(){
        int[][] adj = new int[1024*1024][];
        for( int i = 0; i < adj.length; ++i )
            adj[i] = new int[1024*1024];
    }

    void exit( int val ){
        out.flush();
        System.exit(val);
    }
    //////////////////////////////////////////////////////////////////////////////////////////

    int n, l, r;
    double[] x, y, cosa, sina, dp;
    final double eps = 1e-9, inf = 1e300;

    double fun( int i, double x1 ){
        double
                dx = x1 - x[i],
                dy = - y[i],
                val = dx * sina[i] + dy * cosa[i];
        if( abs(val) < eps ){
            return r;
        }
        else{
            double k = -y[i] / val;
            double x2 = k * ( dx*cosa[i] - dy*sina[i] );
//            if( x1 > x2 + eps )
//                MLE();
            return x[i] + x2;
        }
    }

    double f( int msk ){
        if( dp[msk] == inf ){
            dp[msk] = l;
            for( int i = 0; i < n; ++i ){
                if( 0 < (msk&(1<<i)) ){
                    int sub = msk & ~(1<<i);
                    dp[msk] = max( dp[msk], f(sub) + fun(i,dp[sub]) );
                    dp[msk] = min( dp[msk], r );
                }
            }
        }
        return dp[msk];
    }

    void solve(){
        n = sc.nextInt();
        l = sc.nextInt();
        r = sc.nextInt();
        x = new double[n];
        y = new double[n];
        cosa = new double[n];
        sina = new double[n];
        for( int i = 0; i < n; ++i ){
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            double alfa = sc.nextInt() * PI / 180;
            cosa[i] = cos(alfa);
            sina[i] = sin(alfa);
        }

        dp = new double[1<<n];
        fill( dp, inf );
        out.printf( "%.10f\n", f((1<<n)-1) - l );
    }

}

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {

    /////////////////////////////////////////////////////////////

   static double eps = Math.pow(10, -8);

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        int n = in.nextInt();
        int l = in.nextInt(), r = in.nextInt();
        Point[] points = new Point[n];
        double[] dp= new double[1<<n+10];

        for (int i = 0; i < dp.length; i++) {
            dp[i]=l;
        }
    //    dp[0]=l;
        for (int i = 0; i < n; i++) {
            points[i] = new Point(in.nextInt(), in.nextInt(), in.nextInt());
        }

//            if(iter%1000==0)
//            System.out.println(iter);
        for (int i = 1; i < 1<<n; i++) {
           int k=i;
            int pos=0;

            while(k>0){
             if((k&1)==1){
             int prev=i-1<<pos;
             double fin=dp[prev];
                 Point point = points[pos];

                 double alpha = Math.atan2(point.y, point.x - fin);

                 double theta = point.angle * Math.PI / 180.0;
                 if (alpha + theta + eps >= Math.PI) {
                     fin = r + 1;

                 }
                 else{
                 double d = Math.hypot(point.x - fin, point.y);
                 double add = d * Math.sin(theta) / Math.sin(Math.PI - theta - alpha);
                 //    System.out.println(add+" add");
                 fin += add;  }
               dp[i]=Math.max(dp[i],fin);
             }
            pos++;k>>=1;
            }
            dp[i]=Math.min(r,dp[i]);
        }
     //   System.out.println(dp[3]);
        out.println(dp[(1<<n)-1]-l);
    }
}

class Point implements Comparable<Point> {
    int x, y;
    double angle;

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

    public int compareTo(Point o) {
        if (this.x < o.x) return -1;
        else if (this.x > o.x) return 1;
        else if (this.y > o.y) return 1;

        else if (this.y < o.y) return -1;
        else
            return 0;  //To change body of implemented methods use File | Settings | File Templates.
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
   /////////////////////////////////////////////////////////////
    static double eps=Math.pow(10,-8);
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
    int n=in.nextInt();
    int l=in.nextInt(),r=in.nextInt();
     Point[] points= new Point[n];
        for (int i = 0; i < n; i++) {
            points[i]=new Point(in.nextInt(),in.nextInt(),in.nextInt());
        }
        Arrays.sort(points);
    double fin=l;
        int ii=n-1;
       while(ii>=0&&r-fin>eps){
        Point point=points[ii];
         double alpha= Math.atan2(point.y,point.x-fin);

         double theta=point.angle*Math.PI/180.0;
      //     System.out.println(theta+" t +a "+alpha);
           if(alpha+theta+eps>=Math.PI){
               fin=r+1;
               break;
           }
           double d=Math.hypot(point.x-fin,point.y);
           double add=d*Math.sin(theta)/Math.sin(Math.PI-theta-alpha);
       //    System.out.println(add+" add");
           fin+=add;
           ii--;
       //    System.out.println(fin);
       }
        double ans=0;
        if(fin>r){
          ans=r-l;
        }
        else
        {ans=fin-l;}
        out.println(ans);
    }
    class Point implements Comparable<Point>{
        int x,y;
        double angle;

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

        public int compareTo(Point o) {
            if(this.x<o.x)return -1;
            else if(this.x>o.x)return 1;
            else if(this.y>o.y)return 1;

            else if(this.y<o.y)return -1;
            else
            return 0;  //To change body of implemented methods use File | Settings | File Templates.
        }
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
   /////////////////////////////////////////////////////////////
    static double eps=Math.pow(10,-8);
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
    int n=in.nextInt();
    int l=in.nextInt(),r=in.nextInt();
     Point[] points= new Point[n];
        int[] A= new int[n];
        for (int i = 0; i < n; i++) {
            A[i]=i;
        }

        for (int i = 0; i < n; i++) {
            points[i]=new Point(in.nextInt(),in.nextInt(),in.nextInt());
        }
        Arrays.sort(points);
        double ans=0;
        for (int iter = 0; iter < 200000; iter++) {
//            if(iter%1000==0)
//            System.out.println(iter);
    double fin=l;
        int ii=n-1;
       while(ii>=0&&r-fin>eps){
        Point point=points[A[ii]];
         double alpha= Math.atan2(point.y,point.x-fin);

         double theta=point.angle*Math.PI/180.0;
      //     System.out.println(theta+" t +a "+alpha);
           if(alpha+theta+eps>=Math.PI){
               fin=r+1;
               break;
           }
           double d=Math.hypot(point.x-fin,point.y);
           double add=d*Math.sin(theta)/Math.sin(Math.PI-theta-alpha);
       //    System.out.println(add+" add");
           fin+=add;
           ii--;
       //    System.out.println(fin);
       }

        if(fin>r){
          ans=r-l;
            break;
        }
        else
        {ans=Math.max(ans,fin-l);}
        if(!next_permutation(A)) break;
        }
        out.println(ans);
    }
    class Point implements Comparable<Point>{
        int x,y;
        double angle;

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

        public int compareTo(Point o) {
            if(this.x<o.x)return -1;
            else if(this.x>o.x)return 1;
            else if(this.y>o.y)return 1;

            else if(this.y<o.y)return -1;
            else
            return 0;  //To change body of implemented methods use File | Settings | File Templates.
        }
    }
    // C++ next_permutation() analog in Java
    boolean next_permutation(int[] p) {
        for (int a = p.length - 2; a >= 0; --a)
            if (p[a] < p[a + 1])
                for (int b = p.length - 1;; --b)
                    if (p[b] > p[a]) {
                        int t = p[a];
                        p[a] = p[b];
                        p[b] = t;
                        for (++a, b = p.length - 1; a < b; ++a, --b) {
                            t = p[a];
                            p[a] = p[b];
                            p[b] = t;
                        }
                        return true;
                    }
        return false;
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	while (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

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

    double dp[];
    final static double EPS = 0.00001;

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);
	int n = nextInt(), l = nextInt(), r = nextInt();
	double []x = new double[n];
	double []y = new double[n];
	double []a = new double[n];
	for(int i=0;i<n;i++){
	    x[i] = nextInt();
	    y[i] = nextInt();
	    a[i] = nextInt();
	    /*
	    if (a[i] == 90){
		out.println(r-l);
		out.close();
		return;
	    }
	    */
	    a[i] = Math.toRadians(a[i]);
	}

	dp = new double[1 << n];
	Arrays.fill(dp, -1000000);
	dp[0] = l;
	for(int mask=0;mask<(1<<n);mask++){
	    if (dp[mask] > -1000000){
		for(int i=0;i<n;i++){
		    if ((mask & (1 << i)) == 0){
			double ax = dp[mask] - x[i];
			double ay = -y[i];
			double nx = ax * Math.cos(a[i]) - ay * Math.sin(a[i]);
			double ny = ax * Math.sin(a[i]) + ay * Math.cos(a[i]);
			nx = nx + x[i];
			ny = ny + y[i];

			if (Math.abs(ny - y[i]) <= EPS){
			    out.println(r-l);
			    out.close();
			    return;
			}

			double newx = -y[i] * (nx - x[i])/(ny - y[i]) + x[i];

			//System.out.println(mask + " " + dp[mask] + " " + x[i] + " " + y[i] + " " + newx);
			dp[mask ^ (1 << i)] = Math.max(dp[mask ^ (1 << i)], newx);
		    }
		}
	    }
	}
	double max = dp[0];
	for(int i=0;i<1<<n;i++){
	    max = Math.max(max, dp[i]);
	}
	out.println(Math.min(max,r)-l);
        out.close();
    }

    public static void main(String args[]) throws Exception{
	new Main().run();
    }
}

import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	while (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

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

    double dp[];

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);
	int n = nextInt(), l = nextInt(), r = nextInt();
	double []x = new double[n];
	double []y = new double[n];
	double []a = new double[n];
	for(int i=0;i<n;i++){
	    x[i] = nextInt();
	    y[i] = nextInt();
	    a[i] = nextInt();
	    if (a[i] == 90){
		out.println(r-l);
		out.close();
		return;
	    }
	    a[i] = Math.toRadians(a[i]);
	}

	dp = new double[1 << n];
	Arrays.fill(dp, -1000000);
	dp[0] = l;
	for(int mask=0;mask<(1<<n);mask++){
	    if (dp[mask] > -1000000){
		for(int i=0;i<n;i++){
		    if ((mask & (1 << i)) == 0){
			double ax = dp[mask] - x[i];
			double ay = 0 - y[i];
			double nx = ax * Math.cos(a[i]) - ay * Math.sin(a[i]);
			double ny = ax * Math.sin(a[i]) + ay * Math.cos(a[i]);
			nx = nx + x[i];
			ny = ny + y[i];

			double newx = -y[i] * (nx - x[i])/(ny - y[i]) + x[i];

			//System.out.println(mask + " " + dp[mask] + " " + x[i] + " " + y[i] + " " + newx);
			dp[mask ^ (1 << i)] = Math.max(dp[mask ^ (1 << i)], newx);
		    }
		}
	    }
	}

	out.println(Math.min(dp[(1 << n)-1],r)-l);
        out.close();
    }

    public static void main(String args[]) throws Exception{
	   new Main().run();
    }
}

import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	while (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

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

    double dp[];

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);
	int n = nextInt(), l = nextInt(), r = nextInt();
	double []x = new double[n];
	double []y = new double[n];
	double []a = new double[n];
	for(int i=0;i<n;i++){
	    x[i] = nextInt();
	    y[i] = nextInt();
	    a[i] = nextInt();
	    if (a[i] == 90){
		out.println(r-l);
		out.close();
		return;
	    }
	    a[i] = Math.toRadians(a[i]);
	}

	dp = new double[1 << n];
	Arrays.fill(dp, -1000000);
	dp[0] = l;
	for(int mask=0;mask<(1<<n);mask++){
	    if (dp[mask] > -1000000){
		for(int i=0;i<n;i++){
		    if ((mask & (1 << i)) == 0){
			double ax = dp[mask] - x[i];
			double ay = -y[i];
			double nx = ax * Math.cos(a[i]) - ay * Math.sin(a[i]);
			double ny = ax * Math.sin(a[i]) + ay * Math.cos(a[i]);
			nx = nx + x[i];
			ny = ny + y[i];

			double newx = -y[i] * (nx - x[i])/(ny - y[i]) + x[i];

			//System.out.println(mask + " " + dp[mask] + " " + x[i] + " " + y[i] + " " + newx);
			dp[mask ^ (1 << i)] = Math.max(dp[mask ^ (1 << i)], newx);
		    }
		}
	    }
	}
	double max = dp[0];
	for(int i=0;i<1<<n;i++){
	    max = Math.max(max, dp[i]);
	}
	out.println(Math.min(max,r)-l);
        out.close();
    }

    public static void main(String args[]) throws Exception{
	   new Main().run();
    }
}

import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	while (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

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

    double dp[];

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);
	int n = nextInt(), l = nextInt(), r = nextInt();
	double []x = new double[n];
	double []y = new double[n];
	double []a = new double[n];
	for(int i=0;i<n;i++){
	    x[i] = nextInt();
	    y[i] = nextInt();
	    a[i] = nextInt();
	    /*
	    if (a[i] == 90){
		out.println(r-l);
		out.close();
		return;
	    }
	    */
	    a[i] = Math.toRadians(a[i]);
	}

	dp = new double[1 << n];
	Arrays.fill(dp, -1000000);
	dp[0] = l;
	for(int mask=0;mask<(1<<n);mask++){
	    if (dp[mask] > -1000000){
		for(int i=0;i<n;i++){
		    if ((mask & (1 << i)) == 0){
			double ax = dp[mask] - x[i];
			double ay = -y[i];
			double nx = ax * Math.cos(a[i]) - ay * Math.sin(a[i]);
			double ny = ax * Math.sin(a[i]) + ay * Math.cos(a[i]);
			nx = nx + x[i];
			ny = ny + y[i];

			double newx = -y[i] * (nx - x[i])/(ny - y[i]) + x[i];

			//System.out.println(mask + " " + dp[mask] + " " + x[i] + " " + y[i] + " " + newx);
			dp[mask ^ (1 << i)] = Math.max(dp[mask ^ (1 << i)], newx);
		    }
		}
	    }
	}
	double max = dp[0];
	for(int i=0;i<1<<n;i++){
	    max = Math.max(max, dp[i]);
	}
	out.println(Math.min(max,r)-l);
        out.close();
    }

    public static void main(String args[]) throws Exception{
	   new Main().run();
    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D {

    static StringTokenizer st;
    static BufferedReader br;
    static PrintWriter pw;
    static double[]sin, cos;
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        int L = nextInt();
        int R = nextInt();
        double[][]dp = new double[n][1 << n];
        int[]x = new int[n], y = new int[n];
        double[]a = new double[n];
        sin = new double[n];
        cos = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = nextInt();
            y[i] = nextInt();
            a[i] = nextDouble();
            sin[i] = Math.sin(Math.toRadians(a[i]));
            cos[i] = Math.cos(Math.toRadians(a[i]));
        }
        for (int i = 0; i < n; i++) {
            dp[i][1 << i] = calc(L, x[i], y[i], i);
        }
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                if ((mask & (1 << i)) != 0) {
                    for (int j = 0; j < n; j++) {
                        if ((mask & (1 << j))==0) {
                            dp[j][mask | (1 << j)] = Math.max(dp[j][mask | (1 << j)], calc(dp[i][mask], x[j], y[j], j));
                        }
                    }
                }
            }
        }
        double max = L;
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                max = Math.max(max, dp[i][mask]);
            }
        }
        if (max > R)
            max = R;
        pw.println(max-L);
        pw.close();
    }
    private static double calc(double s, int x, int y, int i) {
        double d = Math.sqrt((x-s)*(x-s)+y*y);
        double sinalfa = y / d;
        double cosalfa = (x-s) / d;
        double r = d * sin[i] / (sin[i]*cosalfa+cos[i]*sinalfa);
        return s+r;
    }
    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
    private static String next() throws IOException {
        while (st==null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}
/*
20 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
*/

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

    static StringTokenizer st;
    static BufferedReader br;
    static PrintWriter pw;
    static double[]sin, cos;
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        int L = nextInt();
        int R = nextInt();
        double[][]dp = new double[n][1 << n];
        for (int i = 0; i < n; i++) {
            Arrays.fill(dp[i], L);
        }
        int[]x = new int[n], y = new int[n];
        double[]a = new double[n];
        sin = new double[n];
        cos = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = nextInt();
            y[i] = nextInt();
            a[i] = nextDouble();
            sin[i] = Math.sin(Math.toRadians(a[i]));
            cos[i] = Math.cos(Math.toRadians(a[i]));
        }
        for (int i = 0; i < n; i++) {
            dp[i][1 << i] = calc(L, x[i], y[i], i);
        }
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                if ((mask & (1 << i)) != 0) {
                    for (int j = 0; j < n; j++) {
                        if ((mask & (1 << j))==0) {
                            dp[j][mask | (1 << j)] = Math.max(dp[j][mask | (1 << j)], calc(dp[i][mask], x[j], y[j], j));
                        }
                    }
                }
            }
        }
        double max = L;
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                max = Math.max(max, dp[i][mask]);
            }
        }
        if (max > R)
            max = R;
        pw.println(max-L);
        pw.close();
    }
    private static double calc(double s, int x, int y, int i) {
        double d = Math.sqrt((x-s)*(x-s)+y*y);
        double sinalfa = y / d;
        double cosalfa = (x-s) / d;
        double r = d * sin[i] / (sin[i]*cosalfa+cos[i]*sinalfa);
        return s+r;
    }
    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
    private static String next() throws IOException {
        while (st==null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}
/*
20 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
*/

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

    static StringTokenizer st;
    static BufferedReader br;
    static PrintWriter pw;
    static double[]sin, cos;
    static double s, d, cosalfa, sinalfa, q, r;
    static int xx, yy, ii;
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        int L = nextInt();
        int R = nextInt();
        double[][]dp = new double[n][1 << n];
        for (int i = 0; i < n; i++) {
            Arrays.fill(dp[i], L);
        }
        double t = 0;
        int[]x = new int[n], y = new int[n];
        double[]a = new double[n];
        sin = new double[n];
        cos = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = nextInt();
            y[i] = nextInt();
            a[i] = nextDouble();
            sin[i] = Math.sin(Math.toRadians(a[i]));
            cos[i] = Math.cos(Math.toRadians(a[i]));
        }
        for (int i = 0; i < n; i++) {
            s = 0;
            xx = x[i];
            yy = y[i];
            ii = i;
            d = Math.sqrt((xx-s)*(xx-s)+yy*yy);
            sinalfa = yy / d;
            cosalfa = (xx-s) / d;
            q = sin[ii]*cosalfa+cos[ii]*sinalfa;
            if (q < 0)
                t =  1e9;
            else {
                r = d * sin[ii] / q;
                t = s+r;
            }
            dp[i][1 << i] = t;
        }
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                if ((mask & (1 << i)) != 0) {
                    for (int j = 0; j < n; j++) {
                        if ((mask & (1 << j))==0) {
                            s = dp[i][mask];
                            xx = x[j];
                            yy = y[j];
                            ii = j;
                            d = Math.sqrt((xx-s)*(xx-s)+yy*yy);
                            sinalfa = yy / d;
                            cosalfa = (xx-s) / d;
                            q = sin[ii]*cosalfa+cos[ii]*sinalfa;
                            if (q < 0)
                                t =  1e9;
                            else {
                                r = d * sin[ii] / q;
                                t = s+r;
                            }
                            dp[j][mask | (1 << j)] = Math.max(dp[j][mask | (1 << j)], t);
                        }
                    }
                }
            }
        }
        double max = L;
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                max = Math.max(max, dp[i][mask]);
            }
        }
        if (max > R)
            max = R;
        pw.println(max-L);
        pw.close();
    }
    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
    private static String next() throws IOException {
        while (st==null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}
/*
20 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
*/

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

    static StringTokenizer st;
    static BufferedReader br;
    static PrintWriter pw;
    static double[]sin, cos;
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        int L = nextInt();
        int R = nextInt();
        double[][]dp = new double[n][1 << n];
        for (int i = 0; i < n; i++) {
            Arrays.fill(dp[i], L);
        }
        int[]x = new int[n], y = new int[n];
        double[]a = new double[n];
        sin = new double[n];
        cos = new double[n];
        for (int i = 0; i < n; i++) {
            x[i] = nextInt();
            y[i] = nextInt();
            a[i] = nextDouble();
            sin[i] = Math.sin(Math.toRadians(a[i]));
            cos[i] = Math.cos(Math.toRadians(a[i]));
        }
        for (int i = 0; i < n; i++) {
            dp[i][1 << i] = calc(L, x[i], y[i], i);
        }
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                if ((mask & (1 << i)) != 0) {
                    for (int j = 0; j < n; j++) {
                        if ((mask & (1 << j))==0) {
                            dp[j][mask | (1 << j)] = Math.max(dp[j][mask | (1 << j)], calc(dp[i][mask], x[j], y[j], j));
                        }
                    }
                }
            }
        }
        double max = L;
        for (int mask = 0; mask < (1 << n); mask++) {
            for (int i = 0; i < n; i++) {
                max = Math.max(max, dp[i][mask]);
            }
        }
        if (max > R)
            max = R;
        pw.println(max-L);
        pw.close();
    }
    private static double calc(double s, int x, int y, int i) {
        double d = Math.sqrt((x-s)*(x-s)+y*y);
        double sinalfa = y / d;
        double cosalfa = (x-s) / d;
        double q = (sin[i] / (sin[i]*cosalfa+cos[i]*sinalfa));
        if (q < 0)
            q = -q;
        double r = d * q;
        return s+r;
    }
    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
    private static String next() throws IOException {
        while (st==null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}
/*
20 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
*/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class R226D2D {
    static class Light{
        int x, y;
        double alpha;
        public Light(int x, int y, int a){
            this.x = x;
            this.y = y;
            this.alpha = Math.PI*a/180;
        }
        public double stretch(double start, double max){
            if(start>=max) return 0;
            double beta = Math.atan2(start-this.x, this.y);
            double uncovered = Math.tan(this.alpha+beta)*this.y;
            return x-start+uncovered;
        }
    }

    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        double start = Integer.parseInt(st.nextToken());
        double end = Integer.parseInt(st.nextToken());
        Light[] lights = new Light[n];
        for(int i=0; i<n; i++){
            st = new StringTokenizer(br.readLine());
            lights[i] = new Light(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()));
        }
        double[] dp = new double[1<<n];
        for(int i=1; i<(1<<n); i++){
            for(int pos=0; pos<n; pos++){
                if((i&(1<<pos))>0){
                    int j = i - (1<<pos);
                    dp[i] = Math.max(dp[i], dp[j]+lights[pos].stretch(start+dp[j], end));
                }
            }
        }
        System.out.println(Math.min(end-start, dp[(1<<n)-1]));
    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class R226D2D {
    static class Light{
        int x, y;
        double alpha;
        public Light(int x, int y, int a){
            this.x = x;
            this.y = y;
            this.alpha = Math.PI*a/180;
        }
        public double stretch(double start){
                double beta = Math.atan2(start-x, y);
                double uncovered = Math.tan(this.alpha+beta)*y;
                return x-start+uncovered;
        }
    }

    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        double start = Integer.parseInt(st.nextToken());
        double end = Integer.parseInt(st.nextToken());
        Light[] lights = new Light[n];
        for(int i=0; i<n; i++){
            st = new StringTokenizer(br.readLine());
            lights[i] = new Light(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()));
        }
        double[] dp = new double[1<<n];
        for(int i=1; i<(1<<n); i++){
            for(int pos=0; pos<n; pos++){
                if((i&(1<<pos))>0){
                    int j = i - (1<<pos);
                    dp[i] = Math.max(dp[i], dp[j]+lights[pos].stretch(start+dp[j]));
                }
            }
        }
        System.out.println(Math.min(end-start, dp[(1<<n)-1]));
    }

}

import java.util.Scanner;

public class Main {

    static double sin[] = new double[91];
    static double cos[] = new double[91];

    static {
        for(int i = 0; i <= 90; ++i){
            sin[i] = Math.sin(Math.PI * i / 180);
            cos[i] = Math.cos(Math.PI * i / 180);
        }
    }

    static class Point{
        final int x;
        final int y;
        final int a;

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

    public static void main(String[] args) {

    }

    int n;
    int l;
    int r;
    Point[] points;

    public double nextEdge(double start, int index){
        Point point = points[index];
        double x1 = start - point.x;
        double y1 = - point.y;

        double y2 = x1 * sin[point.a] + y1 * cos[point.a];
        if (y2 >= 0){
            return r;
        }
        double x2 = x1 * cos[point.a] - y1 * sin[point.a];
        return point.x - x2 * point.y / y2;
    }

    public double solve() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        l = sc.nextInt();
        r = sc.nextInt();
        points = new Point[n];
        for(int i = 0; i < n; ++i){
            points[i] = new Point(
                    sc.nextInt(),
                    sc.nextInt(),
                    sc.nextInt());
        }
        double[] distance = new double[1000001];
        for(int i = 0; i <= 1000000; ++i){
            distance[i] = l - 1;
        }
        int[] visited = new int[1000001];
        int count = 0;
        visited[count++] = 0;
        distance[0] = l;
        int start = 0;

        for(int c = 1; c <= n; ++c){
            int end = count;
            for(int i = start; i < end; ++i){
                int value = visited[i];
                for(int b = 0; b < n; ++b){
                    int mask = 1 << b;
                    if((value & mask) != 0) continue;
                    int cur = value | mask;
                    if(distance[cur] == l - 1)visited[count++] = cur;
                    double next = nextEdge(distance[value], b);
                    if(next >= r) return r - l;
                    if(next > distance[cur]) distance[cur] = next;
                }
            }
            start = end;
        }
        return distance[count - 1] - l;
    }
}

import java.util.Scanner;

public class Main {

    static double sin[] = new double[91];
    static double cos[] = new double[91];

    static {
        for(int i = 0; i <= 90; ++i){
            sin[i] = Math.sin(Math.PI * i / 180);
            cos[i] = Math.cos(Math.PI * i / 180);
        }
    }

    static class Point{
        final int x;
        final int y;
        final int a;

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

    public static void main(String[] args) {
        System.out.print(new Main().solve());
    }

    int n;
    int l;
    int r;
    Point[] points;

    public double nextEdge(double start, int index){
        Point point = points[index];
        double x1 = start - point.x;
        double y1 = - point.y;

        double y2 = x1 * sin[point.a] + y1 * cos[point.a];
        if (y2 >= 0){
            return r;
        }
        double x2 = x1 * cos[point.a] - y1 * sin[point.a];
        return point.x - x2 * point.y / y2;
    }

    public double solve() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        l = sc.nextInt();
        r = sc.nextInt();
        points = new Point[n];
        for(int i = 0; i < n; ++i){
            points[i] = new Point(
                    sc.nextInt(),
                    sc.nextInt(),
                    sc.nextInt());
        }
        double[] distance = new double[1<<21];
        for(int i = 0; i <= 1000000; ++i){
            distance[i] = l - 1;
        }
        int[] visited = new int[1<<21];
        int count = 0;
        visited[count++] = 0;
        distance[0] = l;
        int start = 0;

        for(int c = 1; c <= n; ++c){
            int end = count;
            for(int i = start; i < end; ++i){
                int value = visited[i];
                for(int b = 0; b < n; ++b){
                    int mask = 1 << b;
                    if((value & mask) != 0) continue;
                    int cur = value | mask;
                    if(distance[cur] == l - 1)visited[count++] = cur;
                    double next = nextEdge(distance[value], b);
                    if(next >= r) return r - l;
                    if(next > distance[cur]) distance[cur] = next;
                }
            }
            start = end;
        }
        return distance[count - 1] - l;
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ProblemD {

	static final double EPS = 1e-9;

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		String[] nlr = in.readLine().split(" ");
		int n = Integer.valueOf(nlr[0]);
		int l = Integer.valueOf(nlr[1]);
		int r = Integer.valueOf(nlr[2]);

		long[][] light = new long[n][2];
		double[] rad = new double[n];
		for (int i = 0 ; i < n ; i++) {
			String[] xya = in.readLine().split(" ");
			light[i][0] = Integer.valueOf(xya[0]);
			light[i][1] = Integer.valueOf(xya[1]);
			int ra = Integer.valueOf(xya[2]);
			rad[i] = Math.PI * ra / 180;
		}

		double[] dp = new double[1<<n];
		double best = 0;
		Arrays.fill(dp, Double.MIN_VALUE);
		dp[0] = l;
		for (int i = 0 ; i < (1<<n) ; i++) {
			if (dp[i] + EPS >= l) {
				double left = dp[i];
				for (int j = 0 ; j < n ; j++) {
					if ((i & (1<<j)) >= 1) {
						continue;
					}
					int ti = i|(1<<j);
					double dx = (left - light[j][0]);
					double dy = -light[j][1];

					double tdx = dx * Math.cos(rad[j]) - dy * Math.sin(rad[j]);
					double tdy = dx * Math.sin(rad[j]) + dy * Math.cos(rad[j]);
					double tdxOne = tdx * 1.0d / (Math.abs(tdy) + EPS);
					double tx = light[j][0] + tdxOne;
					if (dp[ti] < tx) {
						dp[ti] = tx;
						best = Math.max(best, dp[ti]);
					}
				}
			}
			if (best > r) {
				break;
			}
		}

		out.println(Math.min(r - l, best - l));
		out.flush();
	}

	static double[] rotate(double dx, double dy, double rad) {
		return new double[]{ dx * Math.cos(rad) - dy * Math.sin(rad), dx * Math.sin(rad) + dy * Math.cos(rad)};
	}

	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ProblemD {

	static final double EPS = 1e-9;

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		String[] nlr = in.readLine().split(" ");
		int n = Integer.valueOf(nlr[0]);
		int l = Integer.valueOf(nlr[1]);
		int r = Integer.valueOf(nlr[2]);

		long[][] light = new long[n][2];
		double[] rad = new double[n];
		for (int i = 0 ; i < n ; i++) {
			String[] xya = in.readLine().split(" ");
			light[i][0] = Integer.valueOf(xya[0]);
			light[i][1] = Integer.valueOf(xya[1]);
			int ra = Integer.valueOf(xya[2]);
			rad[i] = Math.PI * ra / 180;
		}

		double[] dp = new double[1<<n];
		double best = 0;
		Arrays.fill(dp, Double.MIN_VALUE);
		dp[0] = l;
		for (int i = 0 ; i < (1<<n) ; i++) {
			if (dp[i] + EPS >= l) {
				double left = dp[i];
				for (int j = 0 ; j < n ; j++) {
					if ((i & (1<<j)) >= 1) {
						continue;
					}
					int ti = i|(1<<j);
					double dx = (left - light[j][0]);
					double dy = -light[j][1];

					double tdx = dx * Math.cos(rad[j]) - dy * Math.sin(rad[j]);
					double tdy = dx * Math.sin(rad[j]) + dy * Math.cos(rad[j]);
					double tdxOne = tdx * light[j][1] / (Math.abs(tdy) + EPS);
					double tx = light[j][0] + tdxOne;
					if (dp[ti] < tx) {
						dp[ti] = tx;
						best = Math.max(best, dp[ti]);
					}
				}
			}
			if (best > r) {
				break;
			}
		}

		out.println(Math.min(r - l, best - l));
		out.flush();
	}

	static double[] rotate(double dx, double dy, double rad) {
		return new double[]{ dx * Math.cos(rad) - dy * Math.sin(rad), dx * Math.sin(rad) + dy * Math.cos(rad)};
	}

	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ProblemD {

	static final double EPS = 1e-11;

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		String[] nlr = in.readLine().split(" ");
		int n = Integer.valueOf(nlr[0]);
		int l = Integer.valueOf(nlr[1]);
		int r = Integer.valueOf(nlr[2]);

		long[][] light = new long[n][2];
		double[] rad = new double[n];
		for (int i = 0 ; i < n ; i++) {
			String[] xya = in.readLine().split(" ");
			light[i][0] = Integer.valueOf(xya[0]);
			light[i][1] = Integer.valueOf(xya[1]);
			int ra = Integer.valueOf(xya[2]);
			rad[i] = Math.PI * ra / 180;
		}

		double[] dp = new double[1<<n];
		double best = l;
		Arrays.fill(dp, -1e12);
		dp[0] = l;
		for (int i = 0 ; i < (1<<n) ; i++) {
			if (dp[i] + EPS >= l) {
				double left = dp[i];
				for (int j = 0 ; j < n ; j++) {
					if ((i & (1<<j)) >= 1) {
						continue;
					}
					int ti = i|(1<<j);
					double dx = (left - light[j][0]);
					double dy = -light[j][1];
					{
						double tdx = dx * Math.cos(rad[j]) - dy * Math.sin(rad[j]);
						double tdy = dx * Math.sin(rad[j]) + dy * Math.cos(rad[j]);
						double tdxOne = tdx * light[j][1] / (Math.abs(tdy) + EPS);
						double tx = light[j][0] + tdxOne;
						if (dp[ti] < tx) {
							dp[ti] = tx;
							best = Math.max(best, dp[ti]);
						}
					}
				}
			}
			if (best > r) {
				break;
			}
		}

		out.println(Math.min(r - l, best - l));
		out.flush();
	}

	static double[] rotate(double dx, double dy, double rad) {
		return new double[]{ dx * Math.cos(rad) - dy * Math.sin(rad), dx * Math.sin(rad) + dy * Math.cos(rad)};
	}

	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}

}

import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		InputReader in = new InputReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		new Task().go(in, out);
		out.close();
	}

}

class Task {
	public static final int N = 22, MOD = (int) (1e9 + 7);
	public static final double eps = 1e-10;
	double[] sin = new double[N];
	double[] cos = new double[N];
	double[] dp = new double[1<<20];
	int[] x = new int[N];
	int[] y = new int[N];
	int n, l, r;
	public void go(InputReader in, PrintWriter out) {
		n = in.nextInt();
		l = in.nextInt();
		r = in.nextInt();
		for(int i = 0; i < n; i++) {
			x[i] = in.nextInt();
			y[i] = in.nextInt();
			double a = in.nextDouble();
			sin[i] = Math.sin(Math.toRadians(a));
			cos[i] = Math.cos(Math.toRadians(a));
		}

		Arrays.fill(dp, l);
		for(int i = 0; i < n; i++) dp[1<<i] = cal(l, x[i], y[i], i);
		for(int i = 1; i < (1<<n); i++) {
			for(int j = 0; j < n; j++) {
				if((i & (1<<j)) != 0) continue;
				dp[i + (1<<j)] = Math.max(dp[i + (1<<j)], dp[i] + cal(dp[i], x[j], y[j], j));
			}
		}
		out.println(Math.min(dp[(1<<n) - 1], r) - (double) l);
	}

	public double cal(double lef, int x, int y, int id) {
		double dis = Math.sqrt((x - lef) * (x - lef) + (double) y * y);
		double C = (x - lef) / dis;
		double S = y / dis;
		double q = sin[id] * C + cos[id] * S;
		if(q < eps) return 1e9;
		return sin[id] * dis / q + lef;
	}
}

class InputReader {
	BufferedReader bf;
	StringTokenizer st;

	InputReader(InputStreamReader is) {
		bf = new BufferedReader(is);
	}

	public String next() {
		if (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(bf.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

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

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

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
                int n = in.nextInt();
                int L = in.nextInt();
                int R = in.nextInt();
                int[] x = new int[n];
                int[] y = new int[n];
                double a[] = new double[n];
                for (int i = 0; i < n; i++) {
                        x[i] = in.nextInt();
                        y[i] = in.nextInt();
                        a[i] = in.nextInt();
                        a[i] /= 180.0;
                        a[i] *= Math.PI;
                }
                double dp[] = new double[1 << n];
                Arrays.fill(dp, L);
                for (int mask = 0; mask < (1 << n); mask++)
                        for (int i = 0; i < n; i++) {
                                if ((mask & (1 << i)) != 0)
                                        continue;
                                double newX = getNewX(x[i], y[i], a[i], dp[mask]);
                                dp[mask | (1 << i)] = Math.max(dp[mask | (1 << i)], newX);
                        }
                out.format("%.10f", Math.min(dp[(1 << n) - 1] - L, (double)R - L));
        }

        double getNewX(int x0, int y0, double angle, double oldX) {
                double dx = oldX - x0;
                double alpha = Math.atan(dx / y0);
                double beta = alpha + angle;
                if (beta > Math.PI / 2.0 - 1e9)
                        return 1e9;
                return Math.tan(beta) * y0 + x0;
        }
}

class FastScanner {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public FastScanner(InputStream inputStream)  {
                reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String nextToken() {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                        String line;
                        try {
                                line = reader.readLine();
                        } catch (IOException e) {
                                return null;
                        }
                        tokenizer = new StringTokenizer(line);
                }
                return tokenizer.nextToken();
        }

        public int nextInt() {
                return Integer.parseInt(nextToken());
        }

        }

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
                int n = in.nextInt();
                int L = in.nextInt();
                int R = in.nextInt();
                int[] x = new int[n];
                int[] y = new int[n];
                double a[] = new double[n];
                for (int i = 0; i < n; i++) {
                        x[i] = in.nextInt();
                        y[i] = in.nextInt();
                        a[i] = in.nextInt();
                        a[i] /= 180.0;
                        a[i] *= Math.PI;
                }
                double dp[] = new double[1 << n];
                Arrays.fill(dp, L);
                for (int mask = 0; mask < (1 << n); mask++)
                        for (int i = 0; i < n; i++) {
                                if ((mask & (1 << i)) != 0)
                                        continue;
                                double newX = getNewX(x[i], y[i], a[i], dp[mask]);
                                dp[mask | (1 << i)] = Math.max(dp[mask | (1 << i)], newX);
                        }
                out.format("%.10f", Math.min(dp[(1 << n) - 1] - L, (double)R - L));
        }

        double getNewX(int x0, int y0, double angle, double oldX) {
                double dx = oldX - x0;
                double alpha = Math.atan(dx / y0);
                double beta = alpha + angle;
                return Math.tan(beta) * y0 + x0;
        }
}

class FastScanner {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public FastScanner(InputStream inputStream)  {
                reader = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String nextToken() {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                        String line;
                        try {
                                line = reader.readLine();
                        } catch (IOException e) {
                                return null;
                        }
                        tokenizer = new StringTokenizer(line);
                }
                return tokenizer.nextToken();
        }

        public int nextInt() {
                return Integer.parseInt(nextToken());
        }

        }

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main
{
	/********************************************** a list of common variables **********************************************/

	private MyScanner scan = new MyScanner();
	private PrintWriter out = new PrintWriter(System.out);
	private final double PI = Math.acos(-1.0);
	private final int SIZEN = (int)(1e7);
	private final int MOD = (int)(1e9 + 7);

	public double getNext(double p, int x, int y, double a)
	{
		if(p >= x)
		{
			double theta = Math.atan((double)(p - x) / y);
			theta += a;
			return theta >= PI / 2 ? Double.MAX_VALUE : Math.tan(theta) * y + x;
		}
		else
		{
			double theta = Math.atan((double)(x - p) / y);
			if(theta >= a)
			{
				theta -= a;
				return x - Math.tan(theta) * y;
			}
			else
			{
				a -= theta;
				return x + Math.tan(a) * y;
			}
		}
	}

	public void foo()
	{
		int n = scan.nextInt();
		int left = scan.nextInt();
		int right = scan.nextInt();
		int[] x = new int[n];
		int[] y = new int[n];
		int[] a = new int[n];
		for(int i = 0;i < n;++i)
		{
			x[i] = scan.nextInt();
			y[i] = scan.nextInt();
			a[i] = scan.nextInt();
		}
		double[] dp = new double[1 << n];
	//	dp[0] = left;
		for(int i = 0;i < (1 << n);++i)
		{
			for(int j = 0;j < n;++j)
			{
				if(0 == (i & (1 << j)))
				{
					dp[i | (1 << j)] = Math.max(dp[i | (1 << j)], getNext(dp[i], x[j], y[j], a[j] / 180.0 * PI));
				}
			}
		}
		out.println(Math.min(dp[(1 << n) - 1], right) - left);
	}

	public static void main(String[] args)
	{
		Main m = new Main();
		m.foo();
		m.out.close();
	}

	/********************************************** a list of common algorithms **********************************************/

	/**
	 * KMP match, i.e. kmpMatch("abcd", "bcd") = 1, kmpMatch("abcd", "bfcd") = -1.
	 *
	 * @param t: String to match.
	 * @param p: String to be matched.
	 * @return if can match, first index; otherwise -1.
	 */
	public int kmpMatch(char[] t, char[] p)
	{
		int n = t.length;
		int m = p.length;
		int[] next = new int[m + 1];
		next[0] = -1;
		int j = -1;
		for(int i = 1;i < m;++i)
		{
			while(j >= 0 && p[i] != p[j + 1])
			{
				j = next[j];
			}
			if(p[i] == p[j + 1])
			{
				++j;
			}
			next[i] = j;
		}
		j = -1;
		for(int i = 0;i < n;++i)
		{
			while(j >= 0 && t[i] != p[j + 1])
			{
				j = next[j];
			}
			if(t[i] == p[j + 1])
			{
				++j;
			}
			if(j == m - 1)
			{
				return i - m + 1;
			}
		}
		return -1;
	}

	class MyScanner
	{
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    BufferedInputStream bis = new BufferedInputStream(System.in);

	    public int read()
	    {
	        if (-1 == numChars)
	        {
	        	throw new InputMismatchException();
	        }
	        if (curChar >= numChars)
	        {
	            curChar = 0;
	            try
	            {
	                numChars = bis.read(buf);
	            }
	            catch (IOException e)
	            {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	            {
	            	return -1;
	            }
	        }
	        return buf[curChar++];
	    }

	    public int nextInt()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do
	        {
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong()
	    {
	    	int c = read();
	    	while (isSpaceChar(c))
	    	{
	    		c = read();
	    	}
	    	int sgn = 1;
	    	if (c == '-')
	    	{
	    		sgn = -1;
	    		c = read();
	    	}
	    	long res = 0;
	    	do
	    	{
	    		if (c < '0' || c > '9')
	    		{
	    			throw new InputMismatchException();
	    		}
	    		res *= 10;
	    		res += c - '0';
	    		c = read();
	    	} while (!isSpaceChar(c));
	    	return res * sgn;
	    }

	    public double nextDouble()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        double res = 0;
	        while (!isSpaceChar(c) && c != '.')
	        {
	            if (c == 'e' || c == 'E')
	            {
	            	return res * Math.pow(10, nextInt());
	            }
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c & 15;
	            c = read();
	        }
	        if (c == '.')
	        {
	            c = read();
	            double m = 1;
	            while (!isSpaceChar(c))
	            {
	                if (c == 'e' || c == 'E')
	                {
	                	return res * Math.pow(10, nextInt());
	                }
	                if (c < '0' || c > '9')
	                {
	                	throw new InputMismatchException();
	                }
	                m /= 10;
	                res += (c & 15) * m;
	                c = read();
	            }
	        }
	        return res * sgn;
	    }

	    public String next()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        StringBuilder res = new StringBuilder();
	        do
	        {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    private boolean isSpaceChar(int c)
	    {
	        return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
	    }
	}
}

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main
{
	/********************************************** a list of common variables **********************************************/

	private MyScanner scan = new MyScanner();
	private PrintWriter out = new PrintWriter(System.out);
	private final double PI = Math.acos(-1.0);
	private final int SIZEN = (int)(1e7);
	private final int MOD = (int)(1e9 + 7);

	public double getNext(double p, int x, int y, double a)
	{
		if(p >= x)
		{
			double theta = Math.atan2(y, p - x);
			theta += a;
			return theta >= PI / 2 ? Double.MAX_VALUE : Math.tan(theta) * y + x;
		}
		else
		{
			double theta = Math.atan2(y, x - p);
			if(theta >= a)
			{
				theta -= a;
				return x - Math.tan(theta) * y;
			}
			else
			{
				a -= theta;
				return x + Math.tan(a) * y;
			}
		}
	}

	public void foo()
	{
		int n = scan.nextInt();
		int left = scan.nextInt();
		int right = scan.nextInt();
		int[] x = new int[n];
		int[] y = new int[n];
		int[] a = new int[n];
		for(int i = 0;i < n;++i)
		{
			x[i] = scan.nextInt();
			y[i] = scan.nextInt();
			a[i] = scan.nextInt();
		}
		double[] dp = new double[1 << n];
		//dp[0] = left;
		for(int i = 0;i < (1 << n);++i)
		{
			for(int j = 0;j < n;++j)
			{
				if(0 == (i & (1 << j)))
				{
					dp[i | (1 << j)] = Math.max(dp[i | (1 << j)], getNext(dp[i], x[j], y[j], a[j] / 180.0 * PI));
				}
			}
		}
		out.println(Math.min(dp[(1 << n) - 1], right) - left);
	}

	public static void main(String[] args)
	{
		Main m = new Main();
		m.foo();
		m.out.close();
	}

	/********************************************** a list of common algorithms **********************************************/

	/**
	 * KMP match, i.e. kmpMatch("abcd", "bcd") = 1, kmpMatch("abcd", "bfcd") = -1.
	 *
	 * @param t: String to match.
	 * @param p: String to be matched.
	 * @return if can match, first index; otherwise -1.
	 */
	public int kmpMatch(char[] t, char[] p)
	{
		int n = t.length;
		int m = p.length;
		int[] next = new int[m + 1];
		next[0] = -1;
		int j = -1;
		for(int i = 1;i < m;++i)
		{
			while(j >= 0 && p[i] != p[j + 1])
			{
				j = next[j];
			}
			if(p[i] == p[j + 1])
			{
				++j;
			}
			next[i] = j;
		}
		j = -1;
		for(int i = 0;i < n;++i)
		{
			while(j >= 0 && t[i] != p[j + 1])
			{
				j = next[j];
			}
			if(t[i] == p[j + 1])
			{
				++j;
			}
			if(j == m - 1)
			{
				return i - m + 1;
			}
		}
		return -1;
	}

	class MyScanner
	{
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;
	    BufferedInputStream bis = new BufferedInputStream(System.in);

	    public int read()
	    {
	        if (-1 == numChars)
	        {
	        	throw new InputMismatchException();
	        }
	        if (curChar >= numChars)
	        {
	            curChar = 0;
	            try
	            {
	                numChars = bis.read(buf);
	            }
	            catch (IOException e)
	            {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	            {
	            	return -1;
	            }
	        }
	        return buf[curChar++];
	    }

	    public int nextInt()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do
	        {
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c - '0';
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong()
	    {
	    	int c = read();
	    	while (isSpaceChar(c))
	    	{
	    		c = read();
	    	}
	    	int sgn = 1;
	    	if (c == '-')
	    	{
	    		sgn = -1;
	    		c = read();
	    	}
	    	long res = 0;
	    	do
	    	{
	    		if (c < '0' || c > '9')
	    		{
	    			throw new InputMismatchException();
	    		}
	    		res *= 10;
	    		res += c - '0';
	    		c = read();
	    	} while (!isSpaceChar(c));
	    	return res * sgn;
	    }

	    public double nextDouble()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        int sgn = 1;
	        if (c == '-')
	        {
	            sgn = -1;
	            c = read();
	        }
	        double res = 0;
	        while (!isSpaceChar(c) && c != '.')
	        {
	            if (c == 'e' || c == 'E')
	            {
	            	return res * Math.pow(10, nextInt());
	            }
	            if (c < '0' || c > '9')
	            {
	            	throw new InputMismatchException();
	            }
	            res *= 10;
	            res += c & 15;
	            c = read();
	        }
	        if (c == '.')
	        {
	            c = read();
	            double m = 1;
	            while (!isSpaceChar(c))
	            {
	                if (c == 'e' || c == 'E')
	                {
	                	return res * Math.pow(10, nextInt());
	                }
	                if (c < '0' || c > '9')
	                {
	                	throw new InputMismatchException();
	                }
	                m /= 10;
	                res += (c & 15) * m;
	                c = read();
	            }
	        }
	        return res * sgn;
	    }

	    public String next()
	    {
	        int c = read();
	        while (isSpaceChar(c))
	        {
	        	c = read();
	        }
	        StringBuilder res = new StringBuilder();
	        do
	        {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    private boolean isSpaceChar(int c)
	    {
	        return ' ' == c || '\n' == c || '\r' == c || '\t' == c || -1 == c;
	    }
	}
}