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

public class Main {

    private final static int MOD = 998244353; // (int)1e9 + 7;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int a = in.nextInt();
        int b = in.nextInt();
        int a0 = (a * 25 + 1) / 2;
        int a1 = (a * 25 + 26) / 2 - 1;
        int b0 = b * 10;
        int b1 = b * 10 + 9;
        if (b1 < a0 || a1 < b0)
            out.println(-1);
        else if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0);
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }


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

        Main sol = new Main(in, out);

        out.close();
    }
}


class FastScanner{
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

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

    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++];
    }

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

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

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

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

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

    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();
    }

    String nextLine(){
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {

    private final static int MOD = 998244353; // (int)1e9 + 7;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int a = in.nextInt();
        int b = in.nextInt();
        int a0 = (a * 25 + 1) / 2;
        int a1 = (a * 25 + 26) / 2 - 1;
        int b0 = b * 10;
        int b1 = b * 10 + 9;
        if (b1 < a0 || a1 < b0)
            out.println(-1);
        else if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0);
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }


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

        Main sol = new Main(in, out);

        out.close();
    }
} Main private final static int MOD = 998244353; // (int)1e9 + 7; MOD 998244353 private static final int INF = (int)1e9; INF (int)1e9 public Main(FastScanner in, PrintWriter out) {
        int a = in.nextInt();
        int b = in.nextInt();
        int a0 = (a * 25 + 1) / 2;
        int a1 = (a * 25 + 26) / 2 - 1;
        int b0 = b * 10;
        int b1 = b * 10 + 9;
        if (b1 < a0 || a1 < b0)
            out.println(-1);
        else if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0);
    } Main {
        int a = in.nextInt();
        int b = in.nextInt();
        int a0 = (a * 25 + 1) / 2;
        int a1 = (a * 25 + 26) / 2 - 1;
        int b0 = b * 10;
        int b1 = b * 10 + 9;
        if (b1 < a0 || a1 < b0)
            out.println(-1);
        else if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0);
    } int a = in.nextInt(); a in.nextInt() in.nextInt in int b = in.nextInt(); b in.nextInt() in.nextInt in int a0 = (a * 25 + 1) / 2; a0 (a * 25 + 1) / 2 (a * 25 + 1) a * 25 a 25 1 2 int a1 = (a * 25 + 26) / 2 - 1; a1 (a * 25 + 26) / 2 - 1 (a * 25 + 26) / 2 (a * 25 + 26) a * 25 a 25 26 2 1 int b0 = b * 10; b0 b * 10 b 10 int b1 = b * 10 + 9; b1 b * 10 + 9 b * 10 b 10 9 if (b1 < a0 || a1 < b0)
            out.println(-1);
        else if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0); b1 < a0 || a1 < b0 b1 < a0 b1 a0 a1 < b0 a1 b0 out.println(-1) out.println out -1 1 if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0); a0 >= b0 a0 b0 out.println(a0) out.println out a0 if (b0 > a0)
            out.println(b0); b0 > a0 b0 a0 out.println(b0) out.println out b0 FastScanner in in PrintWriter out out private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    } gcd {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    } while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        } true {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        } if (b == 0) return a; b == 0 b 0 return a; a int tmp = a; tmp a a = b a b b = tmp % b b tmp % b tmp b int a a int b b private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    } powm {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    } long res = 1; res 1 while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        } p > 0 p 0 {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        } if (p % 2 == 1)
                res = res * x % MOD; p % 2 == 1 p % 2 p 2 1 res = res * x % MOD res res * x % MOD res * x res x MOD x = x * x % MOD x x * x % MOD x * x x x MOD p /= 2 p 2 return res; res long x x long p p public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);

        out.close();
    } main {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);

        out.close();
    } PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) FastScanner in = new FastScanner(System.in); in new FastScanner(System.in) Main sol = new Main(in, out); sol new Main(in, out) out.close() out.close out String[] args args class FastScanner{
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

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

    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++];
    }

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

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

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

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

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

    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();
    }

    String nextLine(){
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    }
} FastScanner private InputStream stream; stream private byte[] buf = new byte[1024]; buf new byte[1024] 1024 private int curChar; curChar private int numChars; numChars public FastScanner(InputStream stream)
    {
        this.stream = stream;
    } FastScanner {
        this.stream = stream;
    } this.stream = stream this.stream this this.stream stream InputStream stream stream 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++];
    } 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++];
    } if (numChars == -1)
            throw new InputMismatchException(); numChars == -1 numChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        } curChar >= numChars curChar numChars {
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        } curChar = 0 curChar 0 try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            } catch (IOException e) {
                throw new InputMismatchException();
            } IOException e {
                throw new InputMismatchException();
            } throw new InputMismatchException(); new InputMismatchException() {
                numChars = stream.read(buf);
            } numChars = stream.read(buf) numChars stream.read(buf) stream.read stream buf if (numChars <= 0)
                return -1; numChars <= 0 numChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar boolean isSpaceChar(int c)
    {
        return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
    } isSpaceChar {
        return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
    } return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1; c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1 c=='\t' c=='\r' c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1 c==' ' c ' ' c=='\n' c '\n' c=='\r' c '\r' c=='\t' c '\t' c==-1 c -1 1 int c c boolean isEndline(int c)
    {
        return c=='\n'||c=='\r'||c==-1;
    } isEndline {
        return c=='\n'||c=='\r'||c==-1;
    } return c=='\n'||c=='\r'||c==-1; c=='\n'||c=='\r'||c==-1 c=='\n'||c=='\r'||c==-1 c=='\n' c '\n' c=='\r' c '\r' c==-1 c -1 1 int c c int nextInt()
    {
        return Integer.parseInt(next());
    } nextInt {
        return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong()
    {
        return Long.parseLong(next());
    } nextLong {
        return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble()
    {
        return Double.parseDouble(next());
    } nextDouble {
        return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next 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();
    } 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();
    } int c = read(); c read() read while (isSpaceChar(c))
            c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do{
            res.appendCodePoint(c);
            c = read();
        }while(!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res String nextLine(){
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    } nextLine {
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    } int c = read(); c read() read while (isEndline(c))
            c = read(); isEndline(c) isEndline c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c)); !isEndline(c) isEndline(c) isEndline c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public class Main {

    private final static int MOD = 998244353; // (int)1e9 + 7;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int a = in.nextInt();
        int b = in.nextInt();
        int a0 = (a * 25 + 1) / 2;
        int a1 = (a * 25 + 26) / 2 - 1;
        int b0 = b * 10;
        int b1 = b * 10 + 9;
        if (b1 < a0 || a1 < b0)
            out.println(-1);
        else if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0);
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }


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

        Main sol = new Main(in, out);

        out.close();
    }
} public class Main {

    private final static int MOD = 998244353; // (int)1e9 + 7;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int a = in.nextInt();
        int b = in.nextInt();
        int a0 = (a * 25 + 1) / 2;
        int a1 = (a * 25 + 26) / 2 - 1;
        int b0 = b * 10;
        int b1 = b * 10 + 9;
        if (b1 < a0 || a1 < b0)
            out.println(-1);
        else if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0);
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }


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

        Main sol = new Main(in, out);

        out.close();
    }
} Main
import java.util.*;
import java.io.*;

public class Main {

    private final static int MOD = 998244353; // (int)1e9 + 7;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int a = in.nextInt();
        int b = in.nextInt();
        int a0 = (a * 25 + 1) / 2;
        int a1 = (a * 25 + 26) / 2 - 1;
        int b0 = b * 10;
        int b1 = b * 10 + 9;
        if (b1 < a0 || a1 < b0)
            out.println(-1);
        else if (a0 >= b0)
            out.println(a0);
        else if (b0 > a0)
            out.println(b0);
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }


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

        Main sol = new Main(in, out);

        out.close();
    }
}


class FastScanner{
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

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

    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++];
    }

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

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

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

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

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

    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();
    }

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