import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.function.Consumer;

public class Solution456 {

    static MyScanner sc;
    private static PrintWriter out;
    static long M2 = 1_000_000_000L + 7;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();

//
        stringBuilder.append("50 4950 ");
        for (int t = 0; t < 50; t++) {
            stringBuilder.append(" 99 100 80  ");
        }

//        stringBuilder.append("4 319\n" +
//                "63 79 89\n" +
//                "79 97 91\n" +
//                "75 87 88\n" +
//                "75 90 83");

        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }

        out = new PrintWriter(new OutputStreamWriter(System.out));

        initData();
        solve();
        out.flush();
    }

    private static void initData() {
    }

    private static void solve() throws IOException {
        int n = sc.nextInt();
        tx = sc.nextInt();
        int[][] data = new int[n][];
        for (int i = 0; i < n; i++) {
            data[i] = sc.na(3);
        }
        double max = 1000000000;
        double min = 0;

        while (!r(max, min)) {
            double mid = (max + min) / 2;
            if (v(data, mid)) {
                max = mid;
            } else {
                min = mid;
            }
        }
        out.println(min);
    }

    static boolean r(double l1, double l2) {
        return !(Math.abs(l1 - l2) > 0.05) && Math.abs(l1 - l2) / Math.max(1, Math.max(l1, l2)) < 0.0000000000001;
    }

    private static boolean v(int[][] data, double mid) {
        val = mid;
        return sv(data);
    }

    private static double val;
    private static int tx;

    private static boolean sv(int[][] data) {
        double[][] switchr = new double[data.length + 1][tx + 1];

        for (int k = data.length - 1; k >= 0; k--) {
            for (int t = 0; t <= tx; t++) {
                int p1 = data[k][0];
                int p2 = data[k][1];
                int v = data[k][2];
                int v1 = t + p1;
                int v2 = t + p2;
                double t1 = (v1 > tx) ? (p1 + val) : (p1 + switchr[k + 1][v1]);
                double t2 = (v2 > tx) ? (p2 + val) : (p2 + switchr[k + 1][v2]);
                double exp = (t1 * v + (100 - v) * t2) / 100;
                if (exp < val) {
                    if (k == 0) {
                        return true;
                    }
                    switchr[k][t] = exp;
                } else {
                    if (k == 0) {
                        return false;
                    }
                    switchr[k][t] = val;
                }
            }
        }

        return !r(switchr[0][0], val);
    }

    private static final class LogTreePar {

        private final int[] levels;
        private final int[][] parents;

        public LogTreePar(int n) {
            levels = new int[n];
            parents = new int[n][19];
            Arrays.fill(levels, -1);
            for (int[] x : parents) {
                Arrays.fill(x, -1);
            }
        }

        public boolean ispar(int f, int l) {
            if (levels[f] >= levels[l]) return false;
            int diff = levels[l] - levels[f];
            return up(l, diff) == f;
        }

        private int up(int item, int diff) {
            int r = 0;
            while (diff > 0 && item >= 0) {
                if (isset(diff, r)) {
                    diff ^= 1 << r;
                    item = parents[item][r];
                }
                r++;
            }
            return item;
        }

        public void add(int item, int parent) {
            parents[item][0] = parent;
            clt(item);
        }

        protected void clt(int item) {
            levels[item] = levels[parents[item][0]] + 1;
            for (int l = 1; l < 19; l++) {
                if (parents[item][l - 1] == -1) break;
                parents[item][l] = parents[parents[item][l - 1]][l - 1];
            }
        }

        public int lca(int f, int l) {
            if (levels[f] > levels[l]) {
                return lca(l, f);
            }
            return lca1(f, up(l, levels[l] - levels[f]));
        }

        private int lca1(int f1, int f2) {
            for (int r = 18; r >= 0 && f1 != f2; r--) {
                if (parents[f1][r] != parents[f2][r]) {
                    f1 = parents[f1][r];
                    f2 = parents[f2][r];
                }
            }
            return f1 == f2 ? f1 : parents[f1][0];
        }
    }

    private static class P {
        private boolean b;
        private final int ind;
        private final int parent;

        public P(int i, boolean b, int par) {
            this.ind = i;
            this.b = b;
            this.parent = par;

        }
    }

    private static void dfs(int start, int[][] neig, Consumer<int[]> onAdd, Consumer<int[]> onRemove) {
        ArrayList<P> toVisit = new ArrayList<P>(3000);
        toVisit.add(new P(start, true, -1));
        boolean[] vis = new boolean[neig.length];
        vis[start] = true;
        int[] level = new int[neig.length];
        while (toVisit.size() > 0) {
            P ppr = toVisit.remove(toVisit.size() - 1);
            if (!ppr.b) {
                onRemove.accept(new int[]{ppr.ind, level[ppr.ind], ppr.parent});
                continue;
            }
            ppr.b = false;
            int i = ppr.ind;
            toVisit.add(ppr);
            onAdd.accept(new int[]{ppr.ind, level[ppr.ind], ppr.parent});
            for (int kk : neig[i]) {
                if (!vis[kk]) {
                    vis[kk] = true;
                    level[kk] = level[i] + 1;
                    toVisit.add(new P(kk, true, i));
                }
            }
        }

    }

    private static int[][] tr(int n) {
        int[][] x = new int[2][n - 1];
        for (int i = 0; i < n - 1; i++) {
            x[0][i] = sc.nextInt() - 1;
            x[1][i] = sc.nextInt() - 1;
        }
        return pn(x, n);
    }

    private static int[][] pn(int[][] x, int n) {
        int[] ct = new int[n];
        int[][] res = new int[n][];
        for (int v : x[0]) {
            ct[v]++;
        }
        for (int v : x[1]) {
            ct[v]++;
        }
        for (int l = 0; l < n; l++) {
            res[l] = new int[ct[l]];
        }
        for (int i = 0; i < x[0].length; i++) {
            res[x[0][i]][--ct[x[0][i]]] = x[1][i];
            res[x[1][i]][--ct[x[1][i]]] = x[0][i];
        }
        return res;
    }

    private static boolean isset(long i, int k) {
        return (i & (1 << k)) > 0;
    }

    private static void solveT() throws IOException {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }

    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        Integer[] nab(int n) {
            Integer[] k = new Integer[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

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

        int fi() {
            String t = next();
            int cur = 0;
            boolean n = t.charAt(0) == '-';
            for (int a = n ? 1 : 0; a < t.length(); a++) {
                cur = cur * 10 + t.charAt(a) - '0';
            }
            return n ? -cur : cur;
        }

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

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

}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.function.Consumer;

public class Solution456 {

    static MyScanner sc;
    private static PrintWriter out;
    static long M2 = 1_000_000_000L + 7;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();
//
        stringBuilder.append("4 319\n" +
                "63 79 89\n" +
                "79 97 91\n" +
                "75 87 88\n" +
                "75 90 83");

        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }

        out = new PrintWriter(new OutputStreamWriter(System.out));

        initData();
        solve();
        out.flush();
    }

    private static void initData() {
    }

    private static void solve() throws IOException {
        int n = sc.nextInt();
        tx = sc.nextInt();
        int[][] data = new int[n][];
        for (int i = 0; i < n; i++) {
            data[i] = sc.na(3);
        }
        double max = 1000000000;
        double min = 0;

        while (max - min > 0.0000000001) {
            double mid = (max + min) / 2;
            if (v(data, mid)) {
                max = mid;
            } else {
                min = mid;
            }
        }
        out.println(min);
    }

    private static boolean v(int[][] data, double mid) {
        val = mid;
        return sv(data);
    }

    private static double val;
    private static int tx;

    private static boolean sv(int[][] data) {
        double[][] switchr = new double[data.length + 1][tx + 1];

        for (int k = data.length - 1; k >= 0; k--) {
            for (int t = 0; t <= tx; t++) {
                int p1 = data[k][0];
                int p2 = data[k][1];
                int v = data[k][2];
                int v1 = t + p1;
                int v2 = t + p2;
                double t1 = (v1 > tx) ? (p1 + val) : (p1 + switchr[k + 1][v1]);
                double t2 = (v2 > tx) ? (p2 + val) : (p2 + switchr[k + 1][v2]);
                double exp = (t1 * v + (100 - v) * t2) / 100;
                switchr[k][t] = Math.min(exp, val);
            }
        }

        return Math.abs(switchr[0][0] - val) > 0.000000000001;
    }

    private static final class LogTreePar {

        private final int[] levels;
        private final int[][] parents;

        public LogTreePar(int n) {
            levels = new int[n];
            parents = new int[n][19];
            Arrays.fill(levels, -1);
            for (int[] x : parents) {
                Arrays.fill(x, -1);
            }
        }

        public boolean ispar(int f, int l) {
            if (levels[f] >= levels[l]) return false;
            int diff = levels[l] - levels[f];
            return up(l, diff) == f;
        }

        private int up(int item, int diff) {
            int r = 0;
            while (diff > 0 && item >= 0) {
                if (isset(diff, r)) {
                    diff ^= 1 << r;
                    item = parents[item][r];
                }
                r++;
            }
            return item;
        }

        public void add(int item, int parent) {
            parents[item][0] = parent;
            clt(item);
        }

        protected void clt(int item) {
            levels[item] = levels[parents[item][0]] + 1;
            for (int l = 1; l < 19; l++) {
                if (parents[item][l - 1] == -1) break;
                parents[item][l] = parents[parents[item][l - 1]][l - 1];
            }
        }

        public int lca(int f, int l) {
            if (levels[f] > levels[l]) {
                return lca(l, f);
            }
            return lca1(f, up(l, levels[l] - levels[f]));
        }

        private int lca1(int f1, int f2) {
            for (int r = 18; r >= 0 && f1 != f2; r--) {
                if (parents[f1][r] != parents[f2][r]) {
                    f1 = parents[f1][r];
                    f2 = parents[f2][r];
                }
            }
            return f1 == f2 ? f1 : parents[f1][0];
        }
    }

    private static class P {
        private boolean b;
        private final int ind;
        private final int parent;

        public P(int i, boolean b, int par) {
            this.ind = i;
            this.b = b;
            this.parent = par;

        }
    }

    private static void dfs(int start, int[][] neig, Consumer<int[]> onAdd, Consumer<int[]> onRemove) {
        ArrayList<P> toVisit = new ArrayList<P>(3000);
        toVisit.add(new P(start, true, -1));
        boolean[] vis = new boolean[neig.length];
        vis[start] = true;
        int[] level = new int[neig.length];
        while (toVisit.size() > 0) {
            P ppr = toVisit.remove(toVisit.size() - 1);
            if (!ppr.b) {
                onRemove.accept(new int[]{ppr.ind, level[ppr.ind], ppr.parent});
                continue;
            }
            ppr.b = false;
            int i = ppr.ind;
            toVisit.add(ppr);
            onAdd.accept(new int[]{ppr.ind, level[ppr.ind], ppr.parent});
            for (int kk : neig[i]) {
                if (!vis[kk]) {
                    vis[kk] = true;
                    level[kk] = level[i] + 1;
                    toVisit.add(new P(kk, true, i));
                }
            }
        }

    }

    private static int[][] tr(int n) {
        int[][] x = new int[2][n - 1];
        for (int i = 0; i < n - 1; i++) {
            x[0][i] = sc.nextInt() - 1;
            x[1][i] = sc.nextInt() - 1;
        }
        return pn(x, n);
    }

    private static int[][] pn(int[][] x, int n) {
        int[] ct = new int[n];
        int[][] res = new int[n][];
        for (int v : x[0]) {
            ct[v]++;
        }
        for (int v : x[1]) {
            ct[v]++;
        }
        for (int l = 0; l < n; l++) {
            res[l] = new int[ct[l]];
        }
        for (int i = 0; i < x[0].length; i++) {
            res[x[0][i]][--ct[x[0][i]]] = x[1][i];
            res[x[1][i]][--ct[x[1][i]]] = x[0][i];
        }
        return res;
    }

    private static boolean isset(long i, int k) {
        return (i & (1 << k)) > 0;
    }

    private static void solveT() throws IOException {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }

    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        Integer[] nab(int n) {
            Integer[] k = new Integer[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

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

        int fi() {
            String t = next();
            int cur = 0;
            boolean n = t.charAt(0) == '-';
            for (int a = n ? 1 : 0; a < t.length(); a++) {
                cur = cur * 10 + t.charAt(a) - '0';
            }
            return n ? -cur : cur;
        }

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

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

}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.function.Consumer;

public class Solution456 {

    static MyScanner sc;
    private static PrintWriter out;
    static long M2 = 1_000_000_000L + 7;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();
//
//        stringBuilder.append("2 30\n" +
//                "20 30 80\n" +
//                "3 9 85");

        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }

        out = new PrintWriter(new OutputStreamWriter(System.out));

        initData();
        solve();
        out.flush();
    }

    private static void initData() {
    }

    private static void solve() throws IOException {
        int n = sc.nextInt();
        tx = sc.nextInt();
        int[][] data = new int[n][];
        for (int i = 0; i < n; i++) {
            data[i] = sc.na(3);
        }
        double max = 1000000000;
        double min = 0;

        while (max - min > 0.0000000001) {
            double mid = (max + min) / 2;
            if (v(data, mid)) {
                max = mid;
            } else {
                min = mid;
            }
        }
        out.println(min);
    }

    private static boolean v(int[][] data, double mid) {
        val = mid;
        return sv(data);
    }

    private static double val;
    private static int tx;

    private static boolean sv(int[][] data) {
        double[][] switchr = new double[data.length + 1][tx + 1];

        for (int k = data.length - 1; k >= 0; k--) {
            for (int t = 0; t <= tx; t++) {
                int p1 = data[k][0];
                int p2 = data[k][1];
                int v = data[k][2];
                int v1 = t + p1;
                int v2 = t + p2;
                double t1 = (v1 > tx) ? (val) : (p1 + switchr[k + 1][v1]);
                double t2 = (v2 > tx) ? (val) : (p2 + switchr[k + 1][v2]);
                double exp = (t1 * v + (100 - v) * t2) / 100;
                switchr[k][t] = Math.min(exp, val);
            }
        }

        return Math.abs(switchr[0][0] - val) > 0.000000000001;
    }

    private static final class LogTreePar {

        private final int[] levels;
        private final int[][] parents;

        public LogTreePar(int n) {
            levels = new int[n];
            parents = new int[n][19];
            Arrays.fill(levels, -1);
            for (int[] x : parents) {
                Arrays.fill(x, -1);
            }
        }

        public boolean ispar(int f, int l) {
            if (levels[f] >= levels[l]) return false;
            int diff = levels[l] - levels[f];
            return up(l, diff) == f;
        }

        private int up(int item, int diff) {
            int r = 0;
            while (diff > 0 && item >= 0) {
                if (isset(diff, r)) {
                    diff ^= 1 << r;
                    item = parents[item][r];
                }
                r++;
            }
            return item;
        }

        public void add(int item, int parent) {
            parents[item][0] = parent;
            clt(item);
        }

        protected void clt(int item) {
            levels[item] = levels[parents[item][0]] + 1;
            for (int l = 1; l < 19; l++) {
                if (parents[item][l - 1] == -1) break;
                parents[item][l] = parents[parents[item][l - 1]][l - 1];
            }
        }

        public int lca(int f, int l) {
            if (levels[f] > levels[l]) {
                return lca(l, f);
            }
            return lca1(f, up(l, levels[l] - levels[f]));
        }

        private int lca1(int f1, int f2) {
            for (int r = 18; r >= 0 && f1 != f2; r--) {
                if (parents[f1][r] != parents[f2][r]) {
                    f1 = parents[f1][r];
                    f2 = parents[f2][r];
                }
            }
            return f1 == f2 ? f1 : parents[f1][0];
        }
    }

    private static class P {
        private boolean b;
        private final int ind;
        private final int parent;

        public P(int i, boolean b, int par) {
            this.ind = i;
            this.b = b;
            this.parent = par;

        }
    }

    private static void dfs(int start, int[][] neig, Consumer<int[]> onAdd, Consumer<int[]> onRemove) {
        ArrayList<P> toVisit = new ArrayList<P>(3000);
        toVisit.add(new P(start, true, -1));
        boolean[] vis = new boolean[neig.length];
        vis[start] = true;
        int[] level = new int[neig.length];
        while (toVisit.size() > 0) {
            P ppr = toVisit.remove(toVisit.size() - 1);
            if (!ppr.b) {
                onRemove.accept(new int[]{ppr.ind, level[ppr.ind], ppr.parent});
                continue;
            }
            ppr.b = false;
            int i = ppr.ind;
            toVisit.add(ppr);
            onAdd.accept(new int[]{ppr.ind, level[ppr.ind], ppr.parent});
            for (int kk : neig[i]) {
                if (!vis[kk]) {
                    vis[kk] = true;
                    level[kk] = level[i] + 1;
                    toVisit.add(new P(kk, true, i));
                }
            }
        }

    }

    private static int[][] tr(int n) {
        int[][] x = new int[2][n - 1];
        for (int i = 0; i < n - 1; i++) {
            x[0][i] = sc.nextInt() - 1;
            x[1][i] = sc.nextInt() - 1;
        }
        return pn(x, n);
    }

    private static int[][] pn(int[][] x, int n) {
        int[] ct = new int[n];
        int[][] res = new int[n][];
        for (int v : x[0]) {
            ct[v]++;
        }
        for (int v : x[1]) {
            ct[v]++;
        }
        for (int l = 0; l < n; l++) {
            res[l] = new int[ct[l]];
        }
        for (int i = 0; i < x[0].length; i++) {
            res[x[0][i]][--ct[x[0][i]]] = x[1][i];
            res[x[1][i]][--ct[x[1][i]]] = x[0][i];
        }
        return res;
    }

    private static boolean isset(long i, int k) {
        return (i & (1 << k)) > 0;
    }

    private static void solveT() throws IOException {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }

    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        Integer[] nab(int n) {
            Integer[] k = new Integer[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

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

        int fi() {
            String t = next();
            int cur = 0;
            boolean n = t.charAt(0) == '-';
            for (int a = n ? 1 : 0; a < t.length(); a++) {
                cur = cur * 10 + t.charAt(a) - '0';
            }
            return n ? -cur : cur;
        }

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

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

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int T = 1;
            while (T-- > 0)
            {
                solveOne(in, out);
            }
        }

        private void solveOne(Scanner in, PrintWriter out)
        {
            int N = in.nextInt();
            int nums[] = CPUtils.readIntArray(N, in);
            if (N > 90)
            {
                out.println(1);
                return;
            }
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i < N; i++)
            {
                for (int l = 0; l < i; l++)
                {
                    for (int r = i; r < N; r++)
                    {
                        int resL = 0, resR = 0;
                        for (int ll = l; ll < i; ll++) resL ^= nums[ll];
                        for (int rr = i; rr <= r; rr++) resR ^= nums[rr];
                        if (resL > resR)
                        {
                            ans = Math.min(ans, r - l - 1);
                        }
                    }
                }
            }
            if (ans == Integer.MAX_VALUE)
            {
                out.println(-1);
            } else
            {
                out.println(ans);
            }
        }

    }

    static class CPUtils
    {
        public static int[] readIntArray(int size, Scanner in)
        {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
            {
                array[i] = in.nextInt();
            }
            return array;
        }

    }
}


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

public class CF_1456_B{
    //SOLUTION BEGIN
    void pre() throws Exception{}
    void solve(int TC) throws Exception{
        int N = ni();
        int[] A = new int[N];
        for(int i = 0; i< N; i++)A[i] = ni();
        for(int i = 0; i< N-2; i++)if(Integer.highestOneBit(A[i]) == Integer.highestOneBit(A[i+2])){
            pn(1);
            return;
        }
        int ans = INF;
        for(int l = 0; l < N; l++){
            for(int r = l+1; r < N; r++){
                int Xl = 0;
                for(int l2 = l; l2 >= 0; l2--){
                    Xl ^= A[l2];
                    int Xr = 0;
                    for(int r2 = r; r2 < N; r2++){
                        Xr ^= A[r2];
                        if(Xl > Xr)
                            ans = Math.min(ans, l-l2 + r2-r);
                    }
                }
            }
        }
        if(ans == INF)ans = -1;
        pn(ans);
    }
    //SOLUTION END
    void hold(boolean b)throws Exception{if(!b)throw new Exception("Hold right there, Sparky!");}
    void exit(boolean b){if(!b)System.exit(0);}
    static void dbg(Object... o){System.err.println(Arrays.deepToString(o));}
    final long IINF = (long)1e17;
    final int INF = (int)1e9+2;
    DecimalFormat df = new DecimalFormat("0.00000000000");
    double PI = 3.141592653589793238462643383279502884197169399, eps = 1e-8;
    static boolean multipleTC = false, memory = true, fileIO = false;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        long ct = System.currentTimeMillis();
        if (fileIO) {
            in = new FastReader("");
            out = new PrintWriter("");
        } else {
            in = new FastReader();
            out = new PrintWriter(System.out);
        }
        //Solution Credits: Taranpreet Singh
        int T = multipleTC? ni():1;
        pre();
        for (int t = 1; t <= T; t++) solve(t);
        out.flush();
        out.close();
        System.err.println(System.currentTimeMillis() - ct);
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new CF_1456_B().run();}catch(Exception e){e.printStackTrace();System.exit(1);}}}, "1", 1 << 28).start();
        else new CF_1456_B().run();
    }
    int[][] make(int n, int e, int[] from, int[] to, boolean f){
        int[][] g = new int[n][];int[]cnt = new int[n];
        for(int i = 0; i< e; i++){
            cnt[from[i]]++;
            if(f)cnt[to[i]]++;
        }
        for(int i = 0; i< n; i++)g[i] = new int[cnt[i]];
        for(int i = 0; i< e; i++){
            g[from[i]][--cnt[from[i]]] = to[i];
            if(f)g[to[i]][--cnt[to[i]]] = from[i];
        }
        return g;
    }
    int[][][] makeS(int n, int e, int[] from, int[] to, boolean f){
        int[][][] g = new int[n][][];int[]cnt = new int[n];
        for(int i = 0; i< e; i++){
            cnt[from[i]]++;
            if(f)cnt[to[i]]++;
        }
        for(int i = 0; i< n; i++)g[i] = new int[cnt[i]][];
        for(int i = 0; i< e; i++){
            g[from[i]][--cnt[from[i]]] = new int[]{to[i], i, 0};
            if(f)g[to[i]][--cnt[to[i]]] = new int[]{from[i], i, 1};
        }
        return g;
    }
    int find(int[] set, int u){return set[u] = (set[u] == u?u:find(set, set[u]));}
    int digit(long s){int ans = 0;while(s>0){s/=10;ans++;}return ans;}
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object... o){for(Object oo:o)out.print(oo+" ");}
    void pn(Object... o){for(int i = 0; i< o.length; i++)out.print(o[i]+(i+1 < o.length?" ":"\n"));}
    void pni(Object... o){for(Object oo:o)out.print(oo+" ");out.println();out.flush();}
    String n()throws Exception{return in.next();}
    String nln()throws Exception{return in.nextLine();}
    int ni()throws Exception{return Integer.parseInt(in.next());}
    long nl()throws Exception{return Long.parseLong(in.next());}
    double nd()throws Exception{return Double.parseDouble(in.next());}

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

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

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

        String nextLine() throws Exception{
            String str;
            try{
                str = br.readLine();
            }catch (IOException e){
                throw new Exception(e.toString());
            }
            return str;
        }
    }
}


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.ArrayList;
import java.util.StringTokenizer;

public class Edu_48G {

	static int N;
	static long X;
	static long Y;

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		N = Integer.parseInt(inputData.nextToken());
		X = Long.parseLong(inputData.nextToken());
		Y = Long.parseLong(inputData.nextToken());

		if (Y % X != 0) {
			printer.println(0);
			printer.close();
			return;
		}

		long[] fact = new long[20];
		int nF = 0;

		long rem = Y / X;
		if (rem % 2 == 0) {
			rem /= 2;
			fact[nF++] = 2;
			while (rem % 2 == 0) {
				rem /= 2;
			}
		}

		for (int i = 3; i <= 1_000_000; i += 2) {
			if (rem % i == 0) {
				rem /= i;
				fact[nF++] = i;
				while (rem % i == 0) {
					rem /= i;
				}
			}
		}

		// yRem may or may not be prime

		ArrayList<Long> A = new ArrayList<>();
		ArrayList<Long> B = new ArrayList<>();

		inputData = new StringTokenizer(reader.readLine());
		for (int i = 0; i < N; i++) {
			long c = Long.parseLong(inputData.nextToken());
			long cGCD = gcd(c, rem);
			if (cGCD != 1 && cGCD != rem) {
				fact[nF++] = cGCD;
				rem /= cGCD;
				fact[nF++] = rem;
				rem = 1;
			}
			if (c % X == 0) {
				A.add(c);
			}
			if (Y % c == 0) {
				B.add(c);
			}
		}

		if (rem != 1) {
			fact[nF++] = rem;
		}

		int nSets = 1 << nF;
		long[] aSet = new long[nSets];
		long[] bSet = new long[nSets];

		for (long c : A) {
			long cR = c / X;
			int cSet = 0;

			for (int i = 0; i < nF; i++) {
				if (cR % fact[i] == 0) {
					cSet |= (1 << i);
				}
			}
			aSet[cSet]++;
		}

		for (long c : B) {
			long cR = Y / c;
			int cSet = 0;

			for (int i = 0; i < nF; i++) {
				if (cR % fact[i] == 0) {
					cSet |= (1 << i);
				}
			}
			bSet[cSet]++;
		}

		if (nF == 0) {
			printer.println(A.size() * B.size());
			printer.close();
			return;
		}

		long[][] aSetS = new long[nF][nSets];

		for (int cSet = 0; cSet < nSets; cSet++) {
			if ((cSet & 1) != 0) {
				aSetS[0][cSet] = aSet[cSet] + aSet[cSet ^ 1];
			} else {
				aSetS[0][cSet] = aSet[cSet];
			}
		}

		for (int i = 1; i < nF; i++) {
			for (int cSet = 0; cSet < nSets; cSet++) {
				if ((cSet & (1 << i)) != 0) {
					aSetS[i][cSet] = aSetS[i - 1][cSet] + aSetS[i - 1][cSet ^ (1 << i)];
				} else {
					aSetS[i][cSet] = aSetS[i - 1][cSet];
				}
			}
		}
		int mask = nSets - 1;

		long ans = 0;
		for (int cSet = 0; cSet < nSets; cSet++) {
			int comp = mask ^ cSet;
			ans += bSet[cSet] * aSetS[nF - 1][comp];
		}

		printer.println(ans);
		printer.close();
	}

	static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}
}


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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Vadim Semenov
 */
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);
        TaskG solver = new TaskG();
        solver.solve(1, in, out);
        out.close();
    }

    static final class TaskG {
        public void solve(int __, InputReader in, PrintWriter out) {
            int qty = in.nextInt();
            long targetGcd = in.nextLong();
            long targetLcm = in.nextLong();
            long[] rangs = in.nextLongArray(qty);
            if (targetLcm % targetGcd != 0) {
                out.println(0);
                return;
            }
            long[] primes = getPrimes(targetLcm, rangs);
            int[] lcmFactorization = factorize(targetLcm, primes);
            int[] gcdFactorization = factorize(targetGcd, primes);
            int primesQty = 0;
            for (int i = 0; i < primes.length; ++i) {
                if (lcmFactorization[i] > gcdFactorization[i]) {
                    primes[primesQty] = primes[i];
                    lcmFactorization[primesQty] = lcmFactorization[i];
                    gcdFactorization[primesQty] = gcdFactorization[i];
                    ++primesQty;
                }
            }
            if (primesQty < primes.length) {
                primes = Arrays.copyOfRange(primes, 0, primesQty);
                lcmFactorization = Arrays.copyOfRange(lcmFactorization, 0, primesQty);
                gcdFactorization = Arrays.copyOfRange(gcdFactorization, 0, primesQty);
            }
            boolean[] possibleGcd = new boolean[qty];
            boolean[] possibleLcm = new boolean[qty];
            int[] maskGcd = new int[qty];
            int[] maskLcm = new int[qty];
            for (int i = 0; i < qty; ++i) {
                long rang = rangs[i];
                possibleGcd[i] = rang % targetGcd == 0;
                possibleLcm[i] = targetLcm % rang == 0;
                if (!possibleGcd[i] && !possibleLcm[i]) continue;
                int[] factorization = factorize(rang, primes);
                for (int j = 0; j < primes.length; ++j) {
                    if (factorization[j] > gcdFactorization[j]) {
                        maskGcd[i] |= 1 << j;
                    }
                    if (factorization[j] < lcmFactorization[j]) {
                        maskLcm[i] |= 1 << j;
                    }
                }
            }
            int totalMask = (1 << primes.length) - 1;
            int[] count = new int[totalMask + 1];
            for (int i = 0; i < qty; ++i) {
                if (possibleGcd[i]) {
                    count[maskGcd[i]]++;
                }
            }
            for (int mask = totalMask; mask > 0; --mask) {
                for (int subMask = (mask - 1) & mask; subMask > 0; subMask = (subMask - 1) & mask) {
                    count[mask] += count[subMask];
                }
                count[mask] += count[0];
            }
            long answer = 0;
            for (int i = 0; i < qty; ++i) {
                if (possibleLcm[i]) {
                    answer += count[totalMask ^ maskLcm[i]];
                }
            }
            out.println(answer);
        }

        private int[] factorize(long number, long[] primes) {
            int[] powers = new int[primes.length];
            for (int i = 0; i < primes.length; ++i) {
                while (number % primes[i] == 0) {
                    powers[i]++;
                    number /= primes[i];
                }
            }
            return powers;
        }

        private long[] getPrimes(long number, long[] rangs) {
            List<Long> primes = new ArrayList<>();
            for (int p = 2; p <= Math.min(1_000_000, 10 + Math.sqrt(number)); ++p) {
                if (number % p == 0) {
                    primes.add((long) p);
                    while (number % p == 0) {
                        number /= p;
                    }
                }
            }
            if (number > 1) {
                primes.add(number);
                for (long rang : rangs) {
                    long gcd = gcd(rang, number);
                    if (gcd != 1 && gcd != number) {
                        long div = number / gcd;
                        primes.set(primes.size() - 1, Math.min(gcd, div));
                        if (gcd != div) {
                            primes.add(Math.max(gcd, div));
                        }
                    }
                }
            }
            long[] result = new long[primes.size()];
            for (int i = 0; i < primes.size(); ++i) {
                result[i] = primes.get(i);
            }
            return result;
        }

        private static long gcd(long a, long b) {
            while (b != 0) {
                long tmp = a % b;
                a = b;
                b = tmp;
            }
            return a;
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public long[] nextLongArray(int size) {
            long[] array = new long[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextLong();
            }
            return array;
        }

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

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

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }
}


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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Egor Kulikov (egor@egork.net)
 */
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);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	long[] power;

	public void solve(int testNumber, InputReader in, OutputWriter out) {
		int count = in.readInt();
		int[] treeIndex = new int[count];
		int[] vertex = new int[count];
		char[] label = new char[count];
		for (int i = 0; i < count; i++) {
			treeIndex[i] = in.readInt() - 1;
			vertex[i] = in.readInt() - 1;
			label[i] = in.readCharacter();
		}
		power = new long[count + 1];
		power[0] = 1;
		for (int i = 1; i <= count; i++) {
			power[i] = power[i - 1] * 43;
		}
		int firstCount = 0;
		int secondCount = 0;
		for (int i : treeIndex) {
			if (i == 0)
				firstCount++;
			else
				secondCount++;
		}
		long[] hashFirst = new long[firstCount + 1];
		int[] lengthFirst = new int[firstCount + 1];
		long[] hashSecond = new long[secondCount + 1];
		int[] lengthSecond = new int[secondCount + 1];
		int[] parent = new int[secondCount + 1];
		int firstIndex = 0;
		int secondIndex = 0;
		Set<Long> goodHash = new HashSet<Long>();
		for (int i = 0; i < count; i++) {
			if (treeIndex[i] == 0) {
				firstIndex++;
				lengthFirst[firstIndex] = lengthFirst[vertex[i]] + 1;
				hashFirst[firstIndex] = hashFirst[vertex[i]] + power[lengthFirst[vertex[i]]] * label[i];
				goodHash.add(hashFirst[firstIndex]);
			} else {
				secondIndex++;
				lengthSecond[secondIndex] = lengthSecond[vertex[i]] + 1;
				parent[secondIndex] = vertex[i];
				hashSecond[secondIndex] = hashSecond[vertex[i]] * 43 + label[i];
			}
		}
		Counter<Long> firstCounter = new Counter<Long>();
		Counter<Long> secondCounter = new Counter<Long>();
		firstIndex = 0;
		secondIndex = 0;
		long answer = 1;
		for (int i = 0; i < count; i++) {
			if (treeIndex[i] == 0) {
				firstIndex++;
				answer += secondCounter.get(hashFirst[firstIndex]);
				firstCounter.add(hashFirst[firstIndex]);
			} else {
				secondIndex++;
				answer++;
				int current = secondIndex;
				do {
					current = parent[current];
					long curHash = hashSecond[secondIndex] - hashSecond[current] * power[lengthSecond[secondIndex] - lengthSecond[current]];
					if (goodHash.contains(curHash)) {
						answer += firstCounter.get(curHash);
						secondCounter.add(curHash);
					}
				} while (current != 0);
			}
			out.printLine(answer);
		}
	}
}

class InputReader {

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

	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 static boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public char readCharacter() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		return (char) c;
	}

	}

class OutputWriter {
	private final PrintWriter writer;

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

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}

	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 Counter<K> extends HashMap<K, Long> {
	public Counter() {
		super();
	}

	public void add(K key) {
		put(key, get(key) + 1);
	}

	public Long get(Object key) {
		if (containsKey(key))
			return super.get(key);
		return 0L;
	}
}


//package april2021;
import java.io.*;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Queue;

public class G {
	InputStream is;
	FastWriter out;
	String INPUT = "";

	int[][] es = {
			{1, 0, 0, 1, 0},
			{1, 1, 0, 2, 0},
			{2, 0, 0, 1, 1},
			{2, 1, 0, 1, 2},
			{1, 1, 0, 1, 1},
			{2, 1, 0, 2, 1},
			{2, 2, 0, 2, 2},
			{1, 2, 0, 2, 1},
			{1, 1, 0, 1, 1},
			{1, 2, 0, 1, 2},

			{1, 0, 1, 2, 0},
			{1, 1, 1, 3, 0},
			{2, 0, 1, 2, 1},
			{2, 1, 1, 2, 2},
			{1, 1, 1, 2, 1},
			{2, 1, 1, 3, 1},
			{2, 2, 1, 3, 2},
			{1, 2, 1, 3, 1},
			{1, 1, 1, 2, 1},
			{1, 2, 1, 2, 2},
			{1, 0, 2, 2, 1},
			{1, 1, 2, 3, 1},
			{1, 2, 1, 1, 3},
			{2, 0, 2, 2, 2},
			{2, 1, 2, 2, 3},
			{1, 1, 2, 2, 2}
	};

	void solve()
	{
		int n = ni();
		for(int i = 0;i < n;i++){
			int[] a = na(5);
			for(int j = 0;j < 26;j++){
				if(Arrays.equals(a, es[j])){
					out.print((char)('a'+j));
					break;
				}
			}
		}
		out.println();
	}

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

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

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

	private byte[] inbuf = new byte[1024];
	public 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 int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private long[] nal(int n)
	{
		long[] a = new long[n];
		for(int i = 0;i < n;i++)a[i] = nl();
		return a;
	}

	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[][] nmi(int n, int m) {
		int[][] map = new int[n][];
		for(int i = 0;i < n;i++)map[i] = na(m);
		return map;
	}

	private int ni() { return (int)nl(); }

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

	public static class FastWriter
	{
		private static final int BUF_SIZE = 1<<13;
		private final byte[] buf = new byte[BUF_SIZE];
		private final OutputStream out;
		private int ptr = 0;

		private FastWriter(){out = null;}

		public FastWriter(OutputStream os)
		{
			this.out = os;
		}

		public FastWriter(String path)
		{
			try {
				this.out = new FileOutputStream(path);
			} catch (FileNotFoundException e) {
				throw new RuntimeException("FastWriter");
			}
		}

		public FastWriter write(byte b)
		{
			buf[ptr++] = b;
			if(ptr == BUF_SIZE)innerflush();
			return this;
		}

		public FastWriter write(char c)
		{
			return write((byte)c);
		}

		public FastWriter write(char[] s)
		{
			for(char c : s){
				buf[ptr++] = (byte)c;
				if(ptr == BUF_SIZE)innerflush();
			}
			return this;
		}

		public FastWriter write(String s)
		{
			s.chars().forEach(c -> {
				buf[ptr++] = (byte)c;
				if(ptr == BUF_SIZE)innerflush();
			});
			return this;
		}

		private static int countDigits(int l) {
			if (l >= 1000000000) return 10;
			if (l >= 100000000) return 9;
			if (l >= 10000000) return 8;
			if (l >= 1000000) return 7;
			if (l >= 100000) return 6;
			if (l >= 10000) return 5;
			if (l >= 1000) return 4;
			if (l >= 100) return 3;
			if (l >= 10) return 2;
			return 1;
		}

		public FastWriter write(int x)
		{
			if(x == Integer.MIN_VALUE){
				return write((long)x);
			}
			if(ptr + 12 >= BUF_SIZE)innerflush();
			if(x < 0){
				write((byte)'-');
				x = -x;
			}
			int d = countDigits(x);
			for(int i = ptr + d - 1;i >= ptr;i--){
				buf[i] = (byte)('0'+x%10);
				x /= 10;
			}
			ptr += d;
			return this;
		}

		private static int countDigits(long l) {
			if (l >= 1000000000000000000L) return 19;
			if (l >= 100000000000000000L) return 18;
			if (l >= 10000000000000000L) return 17;
			if (l >= 1000000000000000L) return 16;
			if (l >= 100000000000000L) return 15;
			if (l >= 10000000000000L) return 14;
			if (l >= 1000000000000L) return 13;
			if (l >= 100000000000L) return 12;
			if (l >= 10000000000L) return 11;
			if (l >= 1000000000L) return 10;
			if (l >= 100000000L) return 9;
			if (l >= 10000000L) return 8;
			if (l >= 1000000L) return 7;
			if (l >= 100000L) return 6;
			if (l >= 10000L) return 5;
			if (l >= 1000L) return 4;
			if (l >= 100L) return 3;
			if (l >= 10L) return 2;
			return 1;
		}

		public FastWriter write(long x)
		{
			if(x == Long.MIN_VALUE){
				return write("" + x);
			}
			if(ptr + 21 >= BUF_SIZE)innerflush();
			if(x < 0){
				write((byte)'-');
				x = -x;
			}
			int d = countDigits(x);
			for(int i = ptr + d - 1;i >= ptr;i--){
				buf[i] = (byte)('0'+x%10);
				x /= 10;
			}
			ptr += d;
			return this;
		}

		public FastWriter write(double x, int precision)
		{
			if(x < 0){
				write('-');
				x = -x;
			}
			x += Math.pow(10, -precision)/2;
			//		if(x < 0){ x = 0; }
			write((long)x).write(".");
			x -= (long)x;
			for(int i = 0;i < precision;i++){
				x *= 10;
				write((char)('0'+(int)x));
				x -= (int)x;
			}
			return this;
		}

		public FastWriter writeln(char c){
			return write(c).writeln();
		}

		public FastWriter writeln(int x){
			return write(x).writeln();
		}

		public FastWriter writeln(long x){
			return write(x).writeln();
		}

		public FastWriter writeln(double x, int precision){
			return write(x, precision).writeln();
		}

		public FastWriter write(int... xs)
		{
			boolean first = true;
			for(int x : xs) {
				if (!first) write(' ');
				first = false;
				write(x);
			}
			return this;
		}

		public FastWriter write(long... xs)
		{
			boolean first = true;
			for(long x : xs) {
				if (!first) write(' ');
				first = false;
				write(x);
			}
			return this;
		}

		public FastWriter writeln()
		{
			return write((byte)'\n');
		}

		public FastWriter writeln(int... xs)
		{
			return write(xs).writeln();
		}

		public FastWriter writeln(long... xs)
		{
			return write(xs).writeln();
		}

		public FastWriter writeln(char[] line)
		{
			return write(line).writeln();
		}

		public FastWriter writeln(char[]... map)
		{
			for(char[] line : map)write(line).writeln();
			return this;
		}

		public FastWriter writeln(String s)
		{
			return write(s).writeln();
		}

		private void innerflush()
		{
			try {
				out.write(buf, 0, ptr);
				ptr = 0;
			} catch (IOException e) {
				throw new RuntimeException("innerflush");
			}
		}

		public void flush()
		{
			innerflush();
			try {
				out.flush();
			} catch (IOException e) {
				throw new RuntimeException("flush");
			}
		}

		public FastWriter print(byte b) { return write(b); }
		public FastWriter print(char c) { return write(c); }
		public FastWriter print(char[] s) { return write(s); }
		public FastWriter print(String s) { return write(s); }
		public FastWriter print(int x) { return write(x); }
		public FastWriter print(long x) { return write(x); }
		public FastWriter print(double x, int precision) { return write(x, precision); }
		public FastWriter println(char c){ return writeln(c); }
		public FastWriter println(int x){ return writeln(x); }
		public FastWriter println(long x){ return writeln(x); }
		public FastWriter println(double x, int precision){ return writeln(x, precision); }
		public FastWriter print(int... xs) { return write(xs); }
		public FastWriter print(long... xs) { return write(xs); }
		public FastWriter println(int... xs) { return writeln(xs); }
		public FastWriter println(long... xs) { return writeln(xs); }
		public FastWriter println(char[] line) { return writeln(line); }
		public FastWriter println(char[]... map) { return writeln(map); }
		public FastWriter println(String s) { return writeln(s); }
		public FastWriter println() { return writeln(); }
	}

	public void trnz(int... o)
	{
		for(int i = 0;i < o.length;i++)if(o[i] != 0)System.out.print(i+":"+o[i]+" ");
		System.out.println();
	}

	// print ids which are 1
	public void trt(long... o)
	{
		Queue<Integer> stands = new ArrayDeque<>();
		for(int i = 0;i < o.length;i++){
			for(long x = o[i];x != 0;x &= x-1)stands.add(i<<6|Long.numberOfTrailingZeros(x));
		}
		System.out.println(stands);
	}

	public void tf(boolean... r)
	{
		for(boolean x : r)System.out.print(x?'#':'.');
		System.out.println();
	}

	public void tf(boolean[]... b)
	{
		for(boolean[] r : b) {
			for(boolean x : r)System.out.print(x?'#':'.');
			System.out.println();
		}
		System.out.println();
	}

	public void tf(long[]... b)
	{
		if(INPUT.length() != 0) {
			for (long[] r : b) {
				for (long x : r) {
					for (int i = 0; i < 64; i++) {
						System.out.print(x << ~i < 0 ? '#' : '.');
					}
				}
				System.out.println();
			}
			System.out.println();
		}
	}

	public void tf(long... b)
	{
		if(INPUT.length() != 0) {
			for (long x : b) {
				for (int i = 0; i < 64; i++) {
					System.out.print(x << ~i < 0 ? '#' : '.');
				}
			}
			System.out.println();
		}
	}

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


//package april2021;
import java.io.*;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Queue;

public class G {
	InputStream is;
	FastWriter out;
	String INPUT = "10\n" +
			"2 0 0 1 1\n" +
			"1 1 1 2 1\n" +
			"2 1 0 1 2\n" +
			"1 1 0 1 1\n" +
			"2 1 0 2 1\n" +
			"1 1 1 2 1\n" +
			"1 2 1 3 1\n" +
			"2 0 0 1 1\n" +
			"1 1 0 1 1\n" +
			"1 1 2 2 2\n";

	int[][] es = {
			{1, 0, 0, 1, 0},
			{1, 1, 0, 2, 0},
			{2, 0, 0, 1, 1},
			{2, 1, 0, 1, 2},
			{1, 1, 0, 1, 1},
			{2, 1, 0, 2, 1},
			{2, 2, 0, 2, 2},
			{1, 2, 0, 2, 1},
			{1, 1, 0, 1, 1},
			{1, 2, 0, 1, 2},

			{1, 0, 1, 2, 0},
			{1, 1, 1, 3, 0},
			{2, 0, 1, 2, 1},
			{2, 1, 1, 2, 2},
			{1, 1, 1, 2, 1},
			{2, 1, 1, 3, 1},
			{2, 2, 1, 3, 2},
			{1, 2, 1, 3, 1},
			{1, 1, 1, 2, 1},
			{1, 2, 1, 2, 2},
			{1, 0, 2, 2, 1},
			{1, 1, 2, 3, 1},
			{1, 2, 1, 1, 3},
			{2, 0, 2, 2, 2},
			{2, 1, 2, 2, 3},
			{1, 1, 2, 2, 2}
	};

	void solve()
	{
		int n = ni();
		for(int i = 0;i < n;i++){
			int[] a = na(5);
			for(int j = 0;j < 26;j++){
				if(Arrays.equals(a, es[j])){
					out.print((char)('a'+j));
					break;
				}
			}
		}
		out.println();
	}

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

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

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

	private byte[] inbuf = new byte[1024];
	public 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 int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private long[] nal(int n)
	{
		long[] a = new long[n];
		for(int i = 0;i < n;i++)a[i] = nl();
		return a;
	}

	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[][] nmi(int n, int m) {
		int[][] map = new int[n][];
		for(int i = 0;i < n;i++)map[i] = na(m);
		return map;
	}

	private int ni() { return (int)nl(); }

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

	public static class FastWriter
	{
		private static final int BUF_SIZE = 1<<13;
		private final byte[] buf = new byte[BUF_SIZE];
		private final OutputStream out;
		private int ptr = 0;

		private FastWriter(){out = null;}

		public FastWriter(OutputStream os)
		{
			this.out = os;
		}

		public FastWriter(String path)
		{
			try {
				this.out = new FileOutputStream(path);
			} catch (FileNotFoundException e) {
				throw new RuntimeException("FastWriter");
			}
		}

		public FastWriter write(byte b)
		{
			buf[ptr++] = b;
			if(ptr == BUF_SIZE)innerflush();
			return this;
		}

		public FastWriter write(char c)
		{
			return write((byte)c);
		}

		public FastWriter write(char[] s)
		{
			for(char c : s){
				buf[ptr++] = (byte)c;
				if(ptr == BUF_SIZE)innerflush();
			}
			return this;
		}

		public FastWriter write(String s)
		{
			s.chars().forEach(c -> {
				buf[ptr++] = (byte)c;
				if(ptr == BUF_SIZE)innerflush();
			});
			return this;
		}

		private static int countDigits(int l) {
			if (l >= 1000000000) return 10;
			if (l >= 100000000) return 9;
			if (l >= 10000000) return 8;
			if (l >= 1000000) return 7;
			if (l >= 100000) return 6;
			if (l >= 10000) return 5;
			if (l >= 1000) return 4;
			if (l >= 100) return 3;
			if (l >= 10) return 2;
			return 1;
		}

		public FastWriter write(int x)
		{
			if(x == Integer.MIN_VALUE){
				return write((long)x);
			}
			if(ptr + 12 >= BUF_SIZE)innerflush();
			if(x < 0){
				write((byte)'-');
				x = -x;
			}
			int d = countDigits(x);
			for(int i = ptr + d - 1;i >= ptr;i--){
				buf[i] = (byte)('0'+x%10);
				x /= 10;
			}
			ptr += d;
			return this;
		}

		private static int countDigits(long l) {
			if (l >= 1000000000000000000L) return 19;
			if (l >= 100000000000000000L) return 18;
			if (l >= 10000000000000000L) return 17;
			if (l >= 1000000000000000L) return 16;
			if (l >= 100000000000000L) return 15;
			if (l >= 10000000000000L) return 14;
			if (l >= 1000000000000L) return 13;
			if (l >= 100000000000L) return 12;
			if (l >= 10000000000L) return 11;
			if (l >= 1000000000L) return 10;
			if (l >= 100000000L) return 9;
			if (l >= 10000000L) return 8;
			if (l >= 1000000L) return 7;
			if (l >= 100000L) return 6;
			if (l >= 10000L) return 5;
			if (l >= 1000L) return 4;
			if (l >= 100L) return 3;
			if (l >= 10L) return 2;
			return 1;
		}

		public FastWriter write(long x)
		{
			if(x == Long.MIN_VALUE){
				return write("" + x);
			}
			if(ptr + 21 >= BUF_SIZE)innerflush();
			if(x < 0){
				write((byte)'-');
				x = -x;
			}
			int d = countDigits(x);
			for(int i = ptr + d - 1;i >= ptr;i--){
				buf[i] = (byte)('0'+x%10);
				x /= 10;
			}
			ptr += d;
			return this;
		}

		public FastWriter write(double x, int precision)
		{
			if(x < 0){
				write('-');
				x = -x;
			}
			x += Math.pow(10, -precision)/2;
			//		if(x < 0){ x = 0; }
			write((long)x).write(".");
			x -= (long)x;
			for(int i = 0;i < precision;i++){
				x *= 10;
				write((char)('0'+(int)x));
				x -= (int)x;
			}
			return this;
		}

		public FastWriter writeln(char c){
			return write(c).writeln();
		}

		public FastWriter writeln(int x){
			return write(x).writeln();
		}

		public FastWriter writeln(long x){
			return write(x).writeln();
		}

		public FastWriter writeln(double x, int precision){
			return write(x, precision).writeln();
		}

		public FastWriter write(int... xs)
		{
			boolean first = true;
			for(int x : xs) {
				if (!first) write(' ');
				first = false;
				write(x);
			}
			return this;
		}

		public FastWriter write(long... xs)
		{
			boolean first = true;
			for(long x : xs) {
				if (!first) write(' ');
				first = false;
				write(x);
			}
			return this;
		}

		public FastWriter writeln()
		{
			return write((byte)'\n');
		}

		public FastWriter writeln(int... xs)
		{
			return write(xs).writeln();
		}

		public FastWriter writeln(long... xs)
		{
			return write(xs).writeln();
		}

		public FastWriter writeln(char[] line)
		{
			return write(line).writeln();
		}

		public FastWriter writeln(char[]... map)
		{
			for(char[] line : map)write(line).writeln();
			return this;
		}

		public FastWriter writeln(String s)
		{
			return write(s).writeln();
		}

		private void innerflush()
		{
			try {
				out.write(buf, 0, ptr);
				ptr = 0;
			} catch (IOException e) {
				throw new RuntimeException("innerflush");
			}
		}

		public void flush()
		{
			innerflush();
			try {
				out.flush();
			} catch (IOException e) {
				throw new RuntimeException("flush");
			}
		}

		public FastWriter print(byte b) { return write(b); }
		public FastWriter print(char c) { return write(c); }
		public FastWriter print(char[] s) { return write(s); }
		public FastWriter print(String s) { return write(s); }
		public FastWriter print(int x) { return write(x); }
		public FastWriter print(long x) { return write(x); }
		public FastWriter print(double x, int precision) { return write(x, precision); }
		public FastWriter println(char c){ return writeln(c); }
		public FastWriter println(int x){ return writeln(x); }
		public FastWriter println(long x){ return writeln(x); }
		public FastWriter println(double x, int precision){ return writeln(x, precision); }
		public FastWriter print(int... xs) { return write(xs); }
		public FastWriter print(long... xs) { return write(xs); }
		public FastWriter println(int... xs) { return writeln(xs); }
		public FastWriter println(long... xs) { return writeln(xs); }
		public FastWriter println(char[] line) { return writeln(line); }
		public FastWriter println(char[]... map) { return writeln(map); }
		public FastWriter println(String s) { return writeln(s); }
		public FastWriter println() { return writeln(); }
	}

	public void trnz(int... o)
	{
		for(int i = 0;i < o.length;i++)if(o[i] != 0)System.out.print(i+":"+o[i]+" ");
		System.out.println();
	}

	// print ids which are 1
	public void trt(long... o)
	{
		Queue<Integer> stands = new ArrayDeque<>();
		for(int i = 0;i < o.length;i++){
			for(long x = o[i];x != 0;x &= x-1)stands.add(i<<6|Long.numberOfTrailingZeros(x));
		}
		System.out.println(stands);
	}

	public void tf(boolean... r)
	{
		for(boolean x : r)System.out.print(x?'#':'.');
		System.out.println();
	}

	public void tf(boolean[]... b)
	{
		for(boolean[] r : b) {
			for(boolean x : r)System.out.print(x?'#':'.');
			System.out.println();
		}
		System.out.println();
	}

	public void tf(long[]... b)
	{
		if(INPUT.length() != 0) {
			for (long[] r : b) {
				for (long x : r) {
					for (int i = 0; i < 64; i++) {
						System.out.print(x << ~i < 0 ? '#' : '.');
					}
				}
				System.out.println();
			}
			System.out.println();
		}
	}

	public void tf(long... b)
	{
		if(INPUT.length() != 0) {
			for (long x : b) {
				for (int i = 0; i < 64; i++) {
					System.out.print(x << ~i < 0 ? '#' : '.');
				}
			}
			System.out.println();
		}
	}

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


import java.io.*;
import java.util.*;
public class G_EncodedMessage {
	public static void main(String[] args)throws IOException {
		String list[]=new String[26+1];
		for(int i=1;i<=26;i++){
			String s=new String();
			switch(i){
				case 1: s="10010";break;
				case 2: s="11020";break;
				case 3: s="20011";break;
				case 4: s="21012";break;
				case 5: s="11011";break;
				case 6: s="21021";break;
				case 7: s="22021";break;
				case 8: s="12021";break;
				case 9: s="*";break;
				case 10: s="12012";break;
				case 11: s="10120";break;
				case 12: s="11130";break;
				case 13: s="20121";break;
				case 14: s="21122";break;
				case 15: s="11121";break;
				case 16: s="21131";break;
				case 17: s="22132";break;
				case 18: s="12131";break;
				case 19: s="*";break;
				case 20: s="12122";break;
				case 21: s="10221";break;
				case 22: s="11231";break;
				case 23: s="12113";break;
				case 24: s="20222";break;
				case 25: s="21223";break;
				case 26: s="11222";break;
			}
			list[i]=s;
		}
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String res=new String();
		int n=Integer.parseInt(br.readLine());
		for(int i=0;i<n;i++) {
			String s= new String();
			StringTokenizer st = new StringTokenizer(br.readLine().trim());
			for(int j=0;j<5;j++) {
				s+=st.nextToken();
			}
			int index=96;
			for(int k=1;k<=26;k++) {
				int flag=list[k].compareTo(s);
				if(flag==0) {
					index+=k;
					break;
				}
			}
			char c=(char)index;
			res+=c;
		}
		System.out.println(res);
	}
}


import java.io.*;

import java.awt.geom.Point2D;
import java.text.*;
import java.math.*;
import java.util.*;

public class Main implements Runnable {

	final String filename = "";

	final int MOD = 1000000007;

	public void solve() throws Exception {
		int MAX = 101;
		int INF = 1000;
		int[][] C = new int[MAX + 1][MAX + 1];
		for (int i = 0; i <= MAX; i++) {
			C[i][0] = C[i][i] = 1;
			for (int j = 1; j < i; j++)
				C[i][j] = Math.min(C[i - 1][j - 1] + C[i - 1][j], INF);
		}

		int N = iread(), M = iread(), K = iread();
		if (M == 1 || N == 1) {
			out.write("0\n");
			return;
		}
		long ans = 0;
		N /= 2;
		int[][][][] d = new int[2][N][N + 1][K + 1];
		for (int a = 1; a <= N; a++) {
			d[0][N - a][a][1] = 1;
		}
		int step = 0;
		for (int m = 1; m < M; m++) {
			for (int i = 0; i < N; i++)
				for (int j = 0; j <= N; j++)
					Arrays.fill(d[step ^ 1][i][j], 0);
			for (int n = 0; n < N; n++) {
				for (int prev = 1; prev <= N; prev++) {
					for (int k = 1; k <= K; k++) {
						int t = d[step][n][prev][k];
						if (t == 0)
							continue;
						int t1 = (t * k) % MOD;
						// System.out.println("m=" + m + " n=" + n + " prev="
						// + prev + " k=" + k+" ans+="+(t*k*(M-m)));
						ans = (ans + t1 * (M - m)) % MOD;
						for (int next = 1; next <= n; next++) {
							int v = k * C[next + prev - 1][prev - 1];
							if (v > K)
								continue;
							int r = d[step ^ 1][n - next][next][v] + t;
							if (r >= MOD)
								r -= MOD;
							d[step ^ 1][n - next][next][v] = r;
						}
					}
				}
			}
			step ^= 1;
		}
		out.write(ans + "\n");
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new BufferedWriter(new OutputStreamWriter(System.out));
			// in = new BufferedReader(new FileReader(filename+".in"));
			// out = new BufferedWriter(new FileWriter(filename+".out"));
			solve();
			out.flush();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int iread() throws Exception {
		return Integer.parseInt(readword());
	}

	public double dread() throws Exception {
		return Double.parseDouble(readword());
	}

	public long lread() throws Exception {
		return Long.parseLong(readword());
	}

	BufferedReader in;

	BufferedWriter out;

	public String readword() throws IOException {
		StringBuilder b = new StringBuilder();
		int c;
		c = in.read();
		while (c >= 0 && c <= ' ')
			c = in.read();
		if (c < 0)
			return "";
		while (c > ' ') {
			b.append((char) c);
			c = in.read();
		}
		return b.toString();
	}

	public static void main(String[] args) {
		try {
			Locale.setDefault(Locale.US);
		} catch (Exception e) {

		}
		// new Thread(new Main()).start();
		new Thread(null, new Main(), "1", 1 << 25).start();
	}
}


import java.io.InputStreamReader;
import java.io.IOException;
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);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {

    final int MOD = 1000000007;

    private int addMod(int x, int y) {
        int ret = x + y;
        if (ret < 0) ret += MOD;
        if (ret >= MOD) ret -= MOD;

        return ret;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int choose[][] = new int[200][200];
        for (int i = 0; i < choose.length; ++i) {
            choose[i][0] = choose[i][i] = 1;
            for (int j = 1; j < i; ++j) {
                choose[i][j] = choose[i - 1][j] + choose[i - 1][j - 1];
            }
        }

        int n = in.nextInt();
        int m = in.nextInt();
        int upper = in.nextInt();

        int dp[][][][] = new int[2][n + 1][upper + 1][upper + 1];
        for (int i = 1; i + i <= n; ++i) {
            dp[0][2 * i][1][i] = 1;
        }

        int ans = 0;

        for (int i = 0; i < m - 1; ++i) {
            int now = i & 1, next = now ^ 1;

            for (int j = 0; j <= n; ++j) {
                for (int k = 1; k <= upper; ++k) {
                    for (int r = 1; r <= upper; ++r) {
                        dp[next][j][k][r] = 0;
                    }
                }
            }

            for (int j = 1; j * 2 <= n; ++j) {
                dp[next][2 * j][1][j] = 1;
            }

            for (int j = 0; j <= n; ++j) {
                for (int k = 1; k <= upper; ++k) {
                    for (int r = 1; r <= upper; ++r) {
                        if (0 == dp[now][j][k][r]) continue;
                        if (j > 1) {
                            ans = addMod(ans, dp[now][j][k][r]);
                        }
                        for (int delta = 1; j + 2 * delta <= n && delta <= upper; ++delta) {
                            int nextPlan = k * choose[delta + r - 1][r - 1];
                            if (nextPlan > upper) break;
                            dp[next][j + 2 * delta][nextPlan][delta] = addMod(dp[next][j + 2 * delta][nextPlan][delta], dp[now][j][k][r]);
                        }
                    }
                }
            }
        }

        out.println(ans);
    }
}

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

    }


import java.io.*;

import java.awt.geom.Point2D;
import java.text.*;
import java.math.*;
import java.util.*;

public class Main implements Runnable {

	final String filename = "";

	final int MOD = 1000000007;

	public void solve() throws Exception {
		int MAX = 101;
		int INF = 1000;
		int[][] C = new int[MAX + 1][MAX + 1];
		for (int i = 0; i <= MAX; i++) {
			C[i][0] = C[i][i] = 1;
			for (int j = 1; j < i; j++)
				C[i][j] = Math.min(C[i - 1][j - 1] + C[i - 1][j], INF);
		}

		int N = iread(), M = iread(), K = iread();
		if (M == 1 || N == 1) {
			out.write("0\n");
			return;
		}
		long ans = 0;
		N /= 2;
		int[][][][] d = new int[2][N][N + 1][K + 1];
		for (int a = 1; a <= N; a++) {
			d[0][N - a][a][1] = 1;
		}
		int step = 0;
		for (int m = 1; m < M; m++) {
			for (int i = 0; i < N; i++)
				for (int j = 0; j <= N; j++)
					Arrays.fill(d[step ^ 1][i][j], 0);
			for (int n = 0; n < N; n++) {
				for (int prev = 1; prev <= N; prev++) {
					for (int k = 1; k <= K; k++) {
						int t = d[step][n][prev][k];
						if (t == 0)
							continue;
						// System.out.println("m=" + m + " n=" + n + " prev="
						// + prev + " k=" + k+" ans+="+(t*k*(M-m)));
						ans = (ans + t * (M - m)) % MOD;
						for (int next = 1; next <= n; next++) {
							int v = k * C[next + prev - 1][prev - 1];
							if (v > K)
								continue;
							int r = d[step ^ 1][n - next][next][v] + t;
							if (r >= MOD)
								r -= MOD;
							d[step ^ 1][n - next][next][v] = r;
						}
					}
				}
			}
			step ^= 1;
		}
		out.write(ans + "\n");
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new BufferedWriter(new OutputStreamWriter(System.out));
			// in = new BufferedReader(new FileReader(filename+".in"));
			// out = new BufferedWriter(new FileWriter(filename+".out"));
			solve();
			out.flush();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int iread() throws Exception {
		return Integer.parseInt(readword());
	}

	public double dread() throws Exception {
		return Double.parseDouble(readword());
	}

	public long lread() throws Exception {
		return Long.parseLong(readword());
	}

	BufferedReader in;

	BufferedWriter out;

	public String readword() throws IOException {
		StringBuilder b = new StringBuilder();
		int c;
		c = in.read();
		while (c >= 0 && c <= ' ')
			c = in.read();
		if (c < 0)
			return "";
		while (c > ' ') {
			b.append((char) c);
			c = in.read();
		}
		return b.toString();
	}

	public static void main(String[] args) {
		try {
			Locale.setDefault(Locale.US);
		} catch (Exception e) {

		}
		// new Thread(new Main()).start();
		new Thread(null, new Main(), "1", 1 << 25).start();
	}
}


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

public class G {
    FastScanner in;
    PrintWriter out;

    int getLenCost(int len, int k) {
        return (len - 1 + (k - 2)) / (k - 1);
    }

    void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] a = new int[n];
        int sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            sum += a[i];
        }
        sum /= n;
        int[] balance = new int[n];
        for (int i = 0; i + 1 < n; i++) {
            balance[i + 1] = balance[i] + a[i] - sum;
        }
        List<Balance>[] balances = new List[k];
        for (int i = 0; i < balances.length; i++) {
            balances[i] = new ArrayList<>();
        }
        for (int i = 0; i < n; i++) {
            balances[i % (k - 1)].add(new Balance(i, balance[i]));
        }
        for (int i = 0; i < balances.length; i++) {
            Collections.sort(balances[i]);
        }
        int[] lenOfSameBalance = new int[n];
        for (int i = 0; i < n; i++) {
            int curBalance = balance[i];
            List<Balance> where = balances[(i + 1) % (k - 1)];
            int firstPos = firstPosOfSameBalance(where, i + 1, curBalance);
            if (firstPos == -1) {
                lenOfSameBalance[i] = n;
            } else {
                if (firstPos > i) {
                    lenOfSameBalance[i] = firstPos - i;
                } else {
                    lenOfSameBalance[i] = (n - i) + firstPos;
                }
            }
        }
        final int MAX = 20;
        int[][] len = new int[MAX][n];
        int[][] cost = new int[MAX][n];
        for (int i = 0; i < n; i++) {
            len[0][i] = lenOfSameBalance[i];
            cost[0][i] = getLenCost(lenOfSameBalance[i], k);
        }
        for (int i = 1; i < MAX; i++) {
            for (int v = 0; v < n; v++) {
                int nextV = (v + len[i - 1][v]) % n;
                len[i][v] = len[i - 1][v] + len[i - 1][nextV];
                cost[i][v] = cost[i - 1][v] + cost[i - 1][nextV];
                len[i][v] = Math.min(len[i][v], n + 10);
                cost[i][v] = Math.min(cost[i][v], Integer.MAX_VALUE / 3);
            }
        }
        int bestCost = Integer.MAX_VALUE;
        int bestStart = -1;
        for (int start = 0; start < n; start++) {
            int curPos = start;
            int curCost = 0;
            int curLen = 0;
            for (int i = MAX - 1; i >= 0; i--) {
                if (curLen + len[i][curPos] <= n) {
                    int nowLen = len[i][curPos];
                    curCost += cost[i][curPos];
                    curLen += nowLen;
                    curPos = (curPos + nowLen) % n;
                }
            }
            int moreLen = n - curLen;
            curCost += getLenCost(moreLen, k);
            if (curCost < bestCost) {
                bestCost = curCost;
                bestStart = start;
            }
        }
        List<int[]> answers = new ArrayList<>();
        int moreLen = n;
        int v = bestStart;
        while (moreLen > 0) {
            int useLen = Math.min(moreLen, len[0][v]);
            makeGood(answers, a, v, useLen, sum, k);
            v = (v + useLen) % n;
            moreLen -= useLen;
        }
        if (answers.size() != bestCost) {
            throw new AssertionError();
        }
        for (int x : a) {
            if (a[x] != sum) {
                throw new AssertionError();
            }
        }
        out.println(answers.size());
        for (int[] b : answers) {
            for (int x : b) {
                out.print(x + " ");
            }
            out.println();
        }
    }

    void makeGood(List<int[]> answers, int[] a, int from, int len, int sum, int k) {
        if (len <= 1) {
            return;
        }
        int curSum = a[from];
        for (int cnt = 1; ; cnt++) {
            int curStart = from + (cnt - 1) * (k - 1) + 1;
            for (int i = 0; i < k - 1; i++) {
                int pos = (curStart + i) % a.length;
                curSum += a[pos];
            }
            int totalElems = cnt * (k - 1) + 1;
            int needSum = totalElems * sum;

            if (needSum <= curSum) {
                int more = curSum - needSum;
                for (int curSeg = cnt - 1; curSeg >= 0; curSeg--) {
                    int segStart = from + curSeg * (k - 1);
                    int nowSum = 0;
                    for (int j = 0; j < k; j++) {
                        nowSum += a[(segStart + j) % a.length];
                    }
                    int[] answerArray = new int[k + 1];
                    Arrays.fill(answerArray, sum);
                    answerArray[0] = segStart % a.length;
                    answerArray[answerArray.length - 1] += more;
                    for (int j = 1; j < answerArray.length; j++) {
                        nowSum -= answerArray[j];
                    }
                    answerArray[1] += nowSum;
                    answers.add(answerArray);
                    for (int j = 0; j + 1 < answerArray.length; j++) {
                        a[(answerArray[0] + j) % a.length] = answerArray[j + 1];
                    }
                    more = 0;
                }
                makeGood(answers, a, (curStart + k - 2) % a.length, len - cnt * (k - 1), sum, k);
                return;
            }
        }
    }

    int getFirstPosOfBalance(List<Balance> positions, int needBalance) {
        int l = -1, r = positions.size();
        while (r - l > 1) {
            int mid = (l + r) >> 1;
            if (positions.get(mid).balance >= needBalance) {
                r = mid;
            } else {
                l = mid;
            }
        }
        return r;
    }

    int firstPosOfSameBalance(List<Balance> positions, int atleastPos, int needBalance) {
        int from = getFirstPosOfBalance(positions, needBalance);
        int to = getFirstPosOfBalance(positions, needBalance + 1);
        if (from == to) {
            return -1;
        }
        int l = from - 1, r = to;
        while (r - l > 1) {
            int m = (l + r) >> 1;
            if (positions.get(m).pos >= atleastPos) {
                r = m;
            } else {
                l = m;
            }
        }
        if (r != to) {
            return positions.get(r).pos;
        }
        return positions.get(from).pos;
    }

    class Balance implements Comparable<Balance> {
        int pos;
        int balance;

        public Balance(int pos, int balance) {
            this.pos = pos;
            this.balance = balance;
        }

        @Override
        public int compareTo(Balance o) {
            if (balance != o.balance) {
                return Integer.compare(balance, o.balance);
            }
            return Integer.compare(pos, o.pos);
        }

        @Override
        public String toString() {
            return "Balance{" +
                    "pos=" + pos +
                    ", balance=" + balance +
                    '}';
        }
    }

    void run() {
        try {
            in = new FastScanner(new File("G.in"));
            out = new PrintWriter(new File("G.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    void runIO() {

        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

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

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

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

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

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

    public static void main(String[] args) {
        new G().runIO();
    }
}


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

public class G {
    FastScanner in;
    PrintWriter out;

    int getLenCost(int len, int k) {
        if (len <= 1) {
            return 0;
        }
        return (len - 1 + (k - 2)) / (k - 1);
    }

    void solve() {
        int n = in.nextInt();
        int k =in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        solve(a, k);
    }

    void solve123() {
        Random rnd = new Random(123);
        for (int it = 0; it < 123123; it++) {
            System.err.println("ITER = " + it);
            int n = 3 + rnd.nextInt(10);
            int sum = rnd.nextInt(5) * n;
            int[] a = new int[n];
            for (int i = 0; i < sum; i++) {
                a[rnd.nextInt(a.length)]++;
            }
            int k = 2 + rnd.nextInt(n - 2);
            solve(a, k);
        }
    }

    void solve(int[] a, int k) {
//        System.err.println(Arrays.toString(a) + " " + k);
        int n = a.length;
//        int k = in.nextInt();
//        int[] a = new int[n];
        int sum = 0;
        for (int i = 0; i < n; i++) {
//            a[i] = in.nextInt();
            sum += a[i];
        }
        sum /= n;
        int[] balance = new int[n];
        for (int i = 0; i + 1 < n; i++) {
            balance[i + 1] = balance[i] + a[i] - sum;
        }
        List<Balance>[] balances = new List[k];
        for (int i = 0; i < balances.length; i++) {
            balances[i] = new ArrayList<>();
        }
        for (int i = 0; i < n; i++) {
            balances[i % (k - 1)].add(new Balance(i, balance[i]));
        }
        for (int i = 0; i < balances.length; i++) {
            Collections.sort(balances[i]);
        }
        int[] lenOfSameBalance = new int[n];
        for (int i = 0; i < n; i++) {
            int curBalance = balance[i];
            List<Balance> where = balances[(i + 1) % (k - 1)];
            int firstPos = firstPosOfSameBalance(where, i + 1, curBalance);
            if (firstPos == -1) {
                lenOfSameBalance[i] = n;
            } else {
                if (firstPos > i) {
                    lenOfSameBalance[i] = firstPos - i;
                } else {
                    lenOfSameBalance[i] = (n - i) + firstPos;
                }
            }
        }
        final int MAX = 20;
        int[][] len = new int[MAX][n];
        int[][] cost = new int[MAX][n];
        for (int i = 0; i < n; i++) {
            len[0][i] = lenOfSameBalance[i];
            cost[0][i] = getLenCost(lenOfSameBalance[i], k);
//            System.err.println(i + " -> (len = " + len[0][i] + ", cost = " + cost[0][i] + ")");
        }
        for (int i = 1; i < MAX; i++) {
            for (int v = 0; v < n; v++) {
                int nextV = (v + len[i - 1][v]) % n;
                len[i][v] = len[i - 1][v] + len[i - 1][nextV];
                cost[i][v] = cost[i - 1][v] + cost[i - 1][nextV];
                len[i][v] = Math.min(len[i][v], n + 10);
                cost[i][v] = Math.min(cost[i][v], Integer.MAX_VALUE / 3);
            }
        }
        int bestCost = Integer.MAX_VALUE;
        int bestStart = -1;
        for (int start = 0; start < n; start++) {
            int curPos = start;
            int curCost = 0;
            int curLen = 0;
            for (int i = MAX - 1; i >= 0; i--) {
                if (curLen + len[i][curPos] <= n) {
                    int nowLen = len[i][curPos];
                    curCost += cost[i][curPos];
//                    System.err.println("ADD COST " + cost[i][curPos]);
                    curLen += nowLen;
                    curPos = (curPos + nowLen) % n;
                }
            }
            int moreLen = n - curLen;
            curCost += getLenCost(moreLen, k);
//            System.err.println("cost for " + start + " is " + curCost + ", moreLen = " + moreLen);
            if (curCost < bestCost) {
                bestCost = curCost;
                bestStart = start;
            }
        }
        List<int[]> answers = new ArrayList<>();
        int moreLen = n;
        int v = bestStart;
        while (moreLen > 0) {
            int useLen = Math.min(moreLen, len[0][v]);
            makeGood(answers, a, v, useLen, sum, k);
            v = (v + useLen) % n;
            moreLen -= useLen;
        }
        if (answers.size() != bestCost) {
//            System.err.println(answers.size() + ", cost= " + bestCost);
            for (int[] b : answers) {
                System.err.println(Arrays.toString(b));
            }
            throw new AssertionError();
        }
        for (int x : a) {
            if (x != sum) {
                throw new AssertionError(Arrays.toString(a));
            }
        }
        out.println(answers.size());
        for (int[] b : answers) {
            for (int x : b) {
                out.print(x + " ");
            }
            out.println();
        }
    }

    void makeGood(List<int[]> answers, int[] a, int from, int len, int sum, int k) {
        if (len <= 1) {
            return;
        }
//        System.err.println(from + " " + len);
        int curSum = a[from];
        for (int cnt = 1; ; cnt++) {
            int curStart = from + (cnt - 1) * (k - 1) + 1;
            int removeLast = 0;
            for (int i = 0; i < k - 1; i++) {
                if ((cnt - 1) * (k - 1) + 1 + i >= len) {
                    removeLast++;
                    continue;
                }
                int pos = (curStart + i) % a.length;
                curSum += a[pos];
            }
            int totalElems = cnt * (k - 1) + 1;
            totalElems -= removeLast;
            int needSum = totalElems * sum;

            if (needSum <= curSum) {
                int more = curSum - needSum;
                for (int curSeg = cnt - 1; curSeg >= 0; curSeg--) {
                    int segStart = from + curSeg * (k - 1);
                    int nowSum = 0;
                    for (int j = 0; j < k - removeLast; j++) {
                        nowSum += a[(segStart + j) % a.length];
                    }
                    int[] answerArray = new int[k + 1];
                    Arrays.fill(answerArray, sum);
                    answerArray[0] = segStart % a.length;
                    answerArray[answerArray.length - 1] += more;

                    for (int j = answerArray.length - removeLast - 1; j + 1 < answerArray.length; j++) {
                        answerArray[j + 1] = a[(answerArray[0] + j) % a.length];
                    }
                    for (int j = 1; j < answerArray.length - removeLast; j++) {
                        nowSum -= answerArray[j];
                    }
                    if (removeLast != 0 && more != 0) {
                        throw new AssertionError();
                    }
                    answerArray[1] += nowSum;
                    answers.add(answerArray);
                    for (int j = 0; j + 1 < answerArray.length; j++) {
                        a[(answerArray[0] + j) % a.length] = answerArray[j + 1];
                    }
                    more = 0;
                    removeLast = 0;
                }
                makeGood(answers, a, (curStart + k - 2) % a.length, len - cnt * (k - 1), sum, k);
                return;
            }
        }
    }

    int getFirstPosOfBalance(List<Balance> positions, int needBalance) {
        int l = -1, r = positions.size();
        while (r - l > 1) {
            int mid = (l + r) >> 1;
            if (positions.get(mid).balance >= needBalance) {
                r = mid;
            } else {
                l = mid;
            }
        }
        return r;
    }

    int firstPosOfSameBalance(List<Balance> positions, int atleastPos, int needBalance) {
        int from = getFirstPosOfBalance(positions, needBalance);
        int to = getFirstPosOfBalance(positions, needBalance + 1);
        if (from == to) {
            return -1;
        }
        int l = from - 1, r = to;
        while (r - l > 1) {
            int m = (l + r) >> 1;
            if (positions.get(m).pos >= atleastPos) {
                r = m;
            } else {
                l = m;
            }
        }
        if (r != to) {
            return positions.get(r).pos;
        }
        return positions.get(from).pos;
    }

    class Balance implements Comparable<Balance> {
        int pos;
        int balance;

        public Balance(int pos, int balance) {
            this.pos = pos;
            this.balance = balance;
        }

        @Override
        public int compareTo(Balance o) {
            if (balance != o.balance) {
                return Integer.compare(balance, o.balance);
            }
            return Integer.compare(pos, o.pos);
        }

        @Override
        public String toString() {
            return "Balance{" +
                    "pos=" + pos +
                    ", balance=" + balance +
                    '}';
        }
    }

    void run() {
        try {
            in = new FastScanner(new File("G.in"));
            out = new PrintWriter(new File("G.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    void runIO() {

        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

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

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

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

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

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

    public static void main(String[] args) {
        new G().runIO();
    }
}