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

class Main {
    public static void main(String[] args) throws IOException {
        String[] cards = new String[3];
        cards[0] = receive();
        cards[1] = receive();
        cards[2] = receive();

        int player = 0, next;
        while(true) {
            if(cards[player].length() == 0) break;
            next = cards[player].charAt(0) - 'a';
            cards[player] = cards[player].substring(1);
            player = next;
        }

        println((char)(player + 'A'));
        flush();
    }

    // array関連
    static BigInteger arraySum(BigInteger[] arr) {
        BigInteger ret = BigInteger.ZERO;
        for (BigInteger bi : arr)
            ret.add(bi);
        return ret;
    }

    static BigInteger arraySum(int[] arr) {
        BigInteger ret = BigInteger.ZERO;
        for (int i : arr)
            ret.add(BigInteger.valueOf(i));
        return ret;
    }

    // mod関連
    static BigInteger mod = BigInteger.valueOf((int) Math.pow(10, 9) + 7);

    // 数学関連
    static BigInteger gcd(BigInteger x, BigInteger y) {
        if (y.subtract(x).signum() > 0) {
            return gcd(y, x);
        }
        if (y.equals(BigInteger.ZERO)) {
            return x;
        }
        return gcd(y, x.remainder(y));
    }

    static BigInteger gcd(int x, int y) {
        return gcd(BigInteger.valueOf(x), BigInteger.valueOf(y));
    }

    static BigInteger lcm(int x, int y) {
        return lcm(BigInteger.valueOf(x), BigInteger.valueOf(y));
    }

    static BigInteger lcm(BigInteger x, BigInteger y) {
        return x.multiply(y).divide(gcd(x, y));
    }

    static BigInteger lcm(BigInteger[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (BigInteger i : arr) {
            lcm = lcm(lcm, i);
        }
        return lcm;
    }

    static BigInteger lcm(int[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (int i : arr) {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        }
        return lcm;
    }

    static int powerOf2(int x) {
        int ret = 0;
        while (true) {
            if (x % 2 != 0)
                break;
            x /= 2;
            ret++;
        }
        return ret;
    }

    static int digits(int x) {
        int ret = 1;
        while (true) {
            if (x / 10 == 0)
                break;
            x /= 10;
            ret++;
        }
        return ret;
    }

    // 入出力関連
    static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static final PrintWriter pw = new PrintWriter(System.out);

    enum Delimiter {
        NONE(""), SPACE(" "), DOT("\\."), COMMA(",");

        private String regex;

        private Delimiter(String regex) {
            this.regex = regex;
        }

        public String getRegex() {
            return regex;
        }
    }

    static String receive() throws IOException {
        return br.readLine();
    }

    static int receiveInt() throws IOException {
        return Integer.parseInt(br.readLine());
    }

    static BigInteger receiveBigInteger() throws IOException {
        return new BigInteger(br.readLine());
    }

    static char receiveChar() throws IOException {
        return br.readLine().charAt(0);
    }

    static char[] receiveCharArray() throws IOException {
        return br.readLine().toCharArray();
    }

    static int[] receiveIntArray(Delimiter delimiter) throws IOException {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        int[] ret = new int[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = Integer.parseInt(inputs[i]);
        }
        return ret;
    }

    static BigInteger[] receiveBigIntegerArray(Delimiter delimiter) throws IOException {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        BigInteger[] ret = new BigInteger[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = new BigInteger(inputs[i]);
        }
        return ret;
    }

    static String[] receiveStringArray(Delimiter delimiter) throws IOException {
        return br.readLine().split(delimiter.getRegex());
    }

    static void print(Object obj) {
        pw.print(obj);
    }

    static void println(Object obj) {
        pw.println(obj);
    }

    static void println() {
        pw.println("");
    }

    static void flush() {
        pw.flush();
    }
} import java.io.*; io.* java import java.math.*; math.* java import java.util.*; util.* java import java.util.stream.*; stream.* java.util class Main {
    public static void main(String[] args) throws IOException {
        String[] cards = new String[3];
        cards[0] = receive();
        cards[1] = receive();
        cards[2] = receive();

        int player = 0, next;
        while(true) {
            if(cards[player].length() == 0) break;
            next = cards[player].charAt(0) - 'a';
            cards[player] = cards[player].substring(1);
            player = next;
        }

        println((char)(player + 'A'));
        flush();
    }

    // array関連
    static BigInteger arraySum(BigInteger[] arr) {
        BigInteger ret = BigInteger.ZERO;
        for (BigInteger bi : arr)
            ret.add(bi);
        return ret;
    }

    static BigInteger arraySum(int[] arr) {
        BigInteger ret = BigInteger.ZERO;
        for (int i : arr)
            ret.add(BigInteger.valueOf(i));
        return ret;
    }

    // mod関連
    static BigInteger mod = BigInteger.valueOf((int) Math.pow(10, 9) + 7);

    // 数学関連
    static BigInteger gcd(BigInteger x, BigInteger y) {
        if (y.subtract(x).signum() > 0) {
            return gcd(y, x);
        }
        if (y.equals(BigInteger.ZERO)) {
            return x;
        }
        return gcd(y, x.remainder(y));
    }

    static BigInteger gcd(int x, int y) {
        return gcd(BigInteger.valueOf(x), BigInteger.valueOf(y));
    }

    static BigInteger lcm(int x, int y) {
        return lcm(BigInteger.valueOf(x), BigInteger.valueOf(y));
    }

    static BigInteger lcm(BigInteger x, BigInteger y) {
        return x.multiply(y).divide(gcd(x, y));
    }

    static BigInteger lcm(BigInteger[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (BigInteger i : arr) {
            lcm = lcm(lcm, i);
        }
        return lcm;
    }

    static BigInteger lcm(int[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (int i : arr) {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        }
        return lcm;
    }

    static int powerOf2(int x) {
        int ret = 0;
        while (true) {
            if (x % 2 != 0)
                break;
            x /= 2;
            ret++;
        }
        return ret;
    }

    static int digits(int x) {
        int ret = 1;
        while (true) {
            if (x / 10 == 0)
                break;
            x /= 10;
            ret++;
        }
        return ret;
    }

    // 入出力関連
    static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static final PrintWriter pw = new PrintWriter(System.out);

    enum Delimiter {
        NONE(""), SPACE(" "), DOT("\\."), COMMA(",");

        private String regex;

        private Delimiter(String regex) {
            this.regex = regex;
        }

        public String getRegex() {
            return regex;
        }
    }

    static String receive() throws IOException {
        return br.readLine();
    }

    static int receiveInt() throws IOException {
        return Integer.parseInt(br.readLine());
    }

    static BigInteger receiveBigInteger() throws IOException {
        return new BigInteger(br.readLine());
    }

    static char receiveChar() throws IOException {
        return br.readLine().charAt(0);
    }

    static char[] receiveCharArray() throws IOException {
        return br.readLine().toCharArray();
    }

    static int[] receiveIntArray(Delimiter delimiter) throws IOException {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        int[] ret = new int[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = Integer.parseInt(inputs[i]);
        }
        return ret;
    }

    static BigInteger[] receiveBigIntegerArray(Delimiter delimiter) throws IOException {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        BigInteger[] ret = new BigInteger[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = new BigInteger(inputs[i]);
        }
        return ret;
    }

    static String[] receiveStringArray(Delimiter delimiter) throws IOException {
        return br.readLine().split(delimiter.getRegex());
    }

    static void print(Object obj) {
        pw.print(obj);
    }

    static void println(Object obj) {
        pw.println(obj);
    }

    static void println() {
        pw.println("");
    }

    static void flush() {
        pw.flush();
    }
} Main // mod関連
    static BigInteger mod = BigInteger.valueOf((int) Math.pow(10, 9) + 7); mod BigInteger.valueOf((int) Math.pow(10, 9) + 7) BigInteger.valueOf BigInteger (int) Math.pow(10, 9) + 7 (int) Math.pow(10, 9) Math.pow Math 10 9 7 // 入出力関連
    static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) static final PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) public static void main(String[] args) throws IOException {
        String[] cards = new String[3];
        cards[0] = receive();
        cards[1] = receive();
        cards[2] = receive();

        int player = 0, next;
        while(true) {
            if(cards[player].length() == 0) break;
            next = cards[player].charAt(0) - 'a';
            cards[player] = cards[player].substring(1);
            player = next;
        }

        println((char)(player + 'A'));
        flush();
    } main {
        String[] cards = new String[3];
        cards[0] = receive();
        cards[1] = receive();
        cards[2] = receive();

        int player = 0, next;
        while(true) {
            if(cards[player].length() == 0) break;
            next = cards[player].charAt(0) - 'a';
            cards[player] = cards[player].substring(1);
            player = next;
        }

        println((char)(player + 'A'));
        flush();
    } String[] cards = new String[3]; cards new String[3] 3 cards[0] = receive() cards[0] cards 0 receive() receive cards[1] = receive() cards[1] cards 1 receive() receive cards[2] = receive() cards[2] cards 2 receive() receive int player = 0 player 0 next; next while(true) {
            if(cards[player].length() == 0) break;
            next = cards[player].charAt(0) - 'a';
            cards[player] = cards[player].substring(1);
            player = next;
        } true {
            if(cards[player].length() == 0) break;
            next = cards[player].charAt(0) - 'a';
            cards[player] = cards[player].substring(1);
            player = next;
        } if(cards[player].length() == 0) break; cards[player].length() == 0 cards[player].length() cards[player].length cards[player] cards player 0 break; next = cards[player].charAt(0) - 'a' next cards[player].charAt(0) - 'a' cards[player].charAt(0) cards[player].charAt cards[player] cards player 0 'a' cards[player] = cards[player].substring(1) cards[player] cards player cards[player].substring(1) cards[player].substring cards[player] cards player 1 player = next player next println((char)(player + 'A')) println (char)(player + 'A') player 'A' flush() flush String[] args args // array関連
    static BigInteger arraySum(BigInteger[] arr) {
        BigInteger ret = BigInteger.ZERO;
        for (BigInteger bi : arr)
            ret.add(bi);
        return ret;
    } arraySum {
        BigInteger ret = BigInteger.ZERO;
        for (BigInteger bi : arr)
            ret.add(bi);
        return ret;
    } BigInteger ret = BigInteger.ZERO; ret BigInteger.ZERO BigInteger BigInteger.ZERO for (BigInteger bi : arr)
            ret.add(bi); BigInteger bi arr ret.add(bi); ret.add(bi) ret.add ret bi return ret; ret BigInteger[] arr arr static BigInteger arraySum(int[] arr) {
        BigInteger ret = BigInteger.ZERO;
        for (int i : arr)
            ret.add(BigInteger.valueOf(i));
        return ret;
    } arraySum {
        BigInteger ret = BigInteger.ZERO;
        for (int i : arr)
            ret.add(BigInteger.valueOf(i));
        return ret;
    } BigInteger ret = BigInteger.ZERO; ret BigInteger.ZERO BigInteger BigInteger.ZERO for (int i : arr)
            ret.add(BigInteger.valueOf(i)); int i arr ret.add(BigInteger.valueOf(i)); ret.add(BigInteger.valueOf(i)) ret.add ret BigInteger.valueOf(i) BigInteger.valueOf BigInteger i return ret; ret int[] arr arr // 数学関連
    static BigInteger gcd(BigInteger x, BigInteger y) {
        if (y.subtract(x).signum() > 0) {
            return gcd(y, x);
        }
        if (y.equals(BigInteger.ZERO)) {
            return x;
        }
        return gcd(y, x.remainder(y));
    } gcd {
        if (y.subtract(x).signum() > 0) {
            return gcd(y, x);
        }
        if (y.equals(BigInteger.ZERO)) {
            return x;
        }
        return gcd(y, x.remainder(y));
    } if (y.subtract(x).signum() > 0) {
            return gcd(y, x);
        } y.subtract(x).signum() > 0 y.subtract(x).signum() y.subtract(x).signum y.subtract(x) y.subtract y x 0 {
            return gcd(y, x);
        } return gcd(y, x); gcd(y, x) gcd y x if (y.equals(BigInteger.ZERO)) {
            return x;
        } y.equals(BigInteger.ZERO) y.equals y BigInteger.ZERO BigInteger BigInteger.ZERO {
            return x;
        } return x; x return gcd(y, x.remainder(y)); gcd(y, x.remainder(y)) gcd y x.remainder(y) x.remainder x y BigInteger x x BigInteger y y static BigInteger gcd(int x, int y) {
        return gcd(BigInteger.valueOf(x), BigInteger.valueOf(y));
    } gcd {
        return gcd(BigInteger.valueOf(x), BigInteger.valueOf(y));
    } return gcd(BigInteger.valueOf(x), BigInteger.valueOf(y)); gcd(BigInteger.valueOf(x), BigInteger.valueOf(y)) gcd BigInteger.valueOf(x) BigInteger.valueOf BigInteger x BigInteger.valueOf(y) BigInteger.valueOf BigInteger y int x x int y y static BigInteger lcm(int x, int y) {
        return lcm(BigInteger.valueOf(x), BigInteger.valueOf(y));
    } lcm {
        return lcm(BigInteger.valueOf(x), BigInteger.valueOf(y));
    } return lcm(BigInteger.valueOf(x), BigInteger.valueOf(y)); lcm(BigInteger.valueOf(x), BigInteger.valueOf(y)) lcm BigInteger.valueOf(x) BigInteger.valueOf BigInteger x BigInteger.valueOf(y) BigInteger.valueOf BigInteger y int x x int y y static BigInteger lcm(BigInteger x, BigInteger y) {
        return x.multiply(y).divide(gcd(x, y));
    } lcm {
        return x.multiply(y).divide(gcd(x, y));
    } return x.multiply(y).divide(gcd(x, y)); x.multiply(y).divide(gcd(x, y)) x.multiply(y).divide x.multiply(y) x.multiply x y gcd(x, y) gcd x y BigInteger x x BigInteger y y static BigInteger lcm(BigInteger[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (BigInteger i : arr) {
            lcm = lcm(lcm, i);
        }
        return lcm;
    } lcm {
        BigInteger lcm = BigInteger.ONE;
        for (BigInteger i : arr) {
            lcm = lcm(lcm, i);
        }
        return lcm;
    } BigInteger lcm = BigInteger.ONE; lcm BigInteger.ONE BigInteger BigInteger.ONE for (BigInteger i : arr) {
            lcm = lcm(lcm, i);
        } BigInteger i arr {
            lcm = lcm(lcm, i);
        } {
            lcm = lcm(lcm, i);
        } lcm = lcm(lcm, i) lcm lcm(lcm, i) lcm lcm i return lcm; lcm BigInteger[] arr arr static BigInteger lcm(int[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (int i : arr) {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        }
        return lcm;
    } lcm {
        BigInteger lcm = BigInteger.ONE;
        for (int i : arr) {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        }
        return lcm;
    } BigInteger lcm = BigInteger.ONE; lcm BigInteger.ONE BigInteger BigInteger.ONE for (int i : arr) {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        } int i arr {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        } {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        } lcm = lcm(lcm, BigInteger.valueOf(i)) lcm lcm(lcm, BigInteger.valueOf(i)) lcm lcm BigInteger.valueOf(i) BigInteger.valueOf BigInteger i return lcm; lcm int[] arr arr static int powerOf2(int x) {
        int ret = 0;
        while (true) {
            if (x % 2 != 0)
                break;
            x /= 2;
            ret++;
        }
        return ret;
    } powerOf2 {
        int ret = 0;
        while (true) {
            if (x % 2 != 0)
                break;
            x /= 2;
            ret++;
        }
        return ret;
    } int ret = 0; ret 0 while (true) {
            if (x % 2 != 0)
                break;
            x /= 2;
            ret++;
        } true {
            if (x % 2 != 0)
                break;
            x /= 2;
            ret++;
        } if (x % 2 != 0)
                break; x % 2 != 0 x % 2 x 2 0 break; x /= 2 x 2 ret++ ret return ret; ret int x x static int digits(int x) {
        int ret = 1;
        while (true) {
            if (x / 10 == 0)
                break;
            x /= 10;
            ret++;
        }
        return ret;
    } digits {
        int ret = 1;
        while (true) {
            if (x / 10 == 0)
                break;
            x /= 10;
            ret++;
        }
        return ret;
    } int ret = 1; ret 1 while (true) {
            if (x / 10 == 0)
                break;
            x /= 10;
            ret++;
        } true {
            if (x / 10 == 0)
                break;
            x /= 10;
            ret++;
        } if (x / 10 == 0)
                break; x / 10 == 0 x / 10 x 10 0 break; x /= 10 x 10 ret++ ret return ret; ret int x x static String receive() throws IOException {
        return br.readLine();
    } receive {
        return br.readLine();
    } return br.readLine(); br.readLine() br.readLine br static int receiveInt() throws IOException {
        return Integer.parseInt(br.readLine());
    } receiveInt {
        return Integer.parseInt(br.readLine());
    } return Integer.parseInt(br.readLine()); Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br static BigInteger receiveBigInteger() throws IOException {
        return new BigInteger(br.readLine());
    } receiveBigInteger {
        return new BigInteger(br.readLine());
    } return new BigInteger(br.readLine()); new BigInteger(br.readLine()) static char receiveChar() throws IOException {
        return br.readLine().charAt(0);
    } receiveChar {
        return br.readLine().charAt(0);
    } return br.readLine().charAt(0); br.readLine().charAt(0) br.readLine().charAt br.readLine() br.readLine br 0 static char[] receiveCharArray() throws IOException {
        return br.readLine().toCharArray();
    } receiveCharArray {
        return br.readLine().toCharArray();
    } return br.readLine().toCharArray(); br.readLine().toCharArray() br.readLine().toCharArray br.readLine() br.readLine br static int[] receiveIntArray(Delimiter delimiter) throws IOException {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        int[] ret = new int[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = Integer.parseInt(inputs[i]);
        }
        return ret;
    } receiveIntArray {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        int[] ret = new int[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = Integer.parseInt(inputs[i]);
        }
        return ret;
    } String[] inputs = br.readLine().split(delimiter.getRegex()); inputs br.readLine().split(delimiter.getRegex()) br.readLine().split br.readLine() br.readLine br delimiter.getRegex() delimiter.getRegex delimiter int[] ret = new int[inputs.length]; ret new int[inputs.length] inputs.length inputs inputs.length for (int i = 0; i < inputs.length; i++) {
            ret[i] = Integer.parseInt(inputs[i]);
        } int i = 0; int i = 0; i 0 i < inputs.length i inputs.length inputs inputs.length i++ i++ i {
            ret[i] = Integer.parseInt(inputs[i]);
        } {
            ret[i] = Integer.parseInt(inputs[i]);
        } ret[i] = Integer.parseInt(inputs[i]) ret[i] ret i Integer.parseInt(inputs[i]) Integer.parseInt Integer inputs[i] inputs i return ret; ret Delimiter delimiter delimiter static BigInteger[] receiveBigIntegerArray(Delimiter delimiter) throws IOException {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        BigInteger[] ret = new BigInteger[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = new BigInteger(inputs[i]);
        }
        return ret;
    } receiveBigIntegerArray {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        BigInteger[] ret = new BigInteger[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = new BigInteger(inputs[i]);
        }
        return ret;
    } String[] inputs = br.readLine().split(delimiter.getRegex()); inputs br.readLine().split(delimiter.getRegex()) br.readLine().split br.readLine() br.readLine br delimiter.getRegex() delimiter.getRegex delimiter BigInteger[] ret = new BigInteger[inputs.length]; ret new BigInteger[inputs.length] inputs.length inputs inputs.length for (int i = 0; i < inputs.length; i++) {
            ret[i] = new BigInteger(inputs[i]);
        } int i = 0; int i = 0; i 0 i < inputs.length i inputs.length inputs inputs.length i++ i++ i {
            ret[i] = new BigInteger(inputs[i]);
        } {
            ret[i] = new BigInteger(inputs[i]);
        } ret[i] = new BigInteger(inputs[i]) ret[i] ret i new BigInteger(inputs[i]) return ret; ret Delimiter delimiter delimiter static String[] receiveStringArray(Delimiter delimiter) throws IOException {
        return br.readLine().split(delimiter.getRegex());
    } receiveStringArray {
        return br.readLine().split(delimiter.getRegex());
    } return br.readLine().split(delimiter.getRegex()); br.readLine().split(delimiter.getRegex()) br.readLine().split br.readLine() br.readLine br delimiter.getRegex() delimiter.getRegex delimiter Delimiter delimiter delimiter static void print(Object obj) {
        pw.print(obj);
    } print {
        pw.print(obj);
    } pw.print(obj) pw.print pw obj Object obj obj static void println(Object obj) {
        pw.println(obj);
    } println {
        pw.println(obj);
    } pw.println(obj) pw.println pw obj Object obj obj static void println() {
        pw.println("");
    } println {
        pw.println("");
    } pw.println("") pw.println pw "" static void flush() {
        pw.flush();
    } flush {
        pw.flush();
    } pw.flush() pw.flush pw enum Delimiter {
        NONE(""), SPACE(" "), DOT("\\."), COMMA(",");

        private String regex;

        private Delimiter(String regex) {
            this.regex = regex;
        }

        public String getRegex() {
            return regex;
        }
    } Delimiter NONE("") NONE SPACE(" ") SPACE DOT("\\.") DOT COMMA(",") COMMA private String regex; regex private Delimiter(String regex) {
            this.regex = regex;
        } Delimiter {
            this.regex = regex;
        } this.regex = regex this.regex this this.regex regex String regex regex public String getRegex() {
            return regex;
        } getRegex {
            return regex;
        } return regex; regex import java.io.*;
import java.math.*;
 import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;

class Main {
 
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;

class Main {
    public static void main(String[] args) throws IOException {
        String[] cards = new String[3];
        cards[0] = receive();
        cards[1] = receive();
        cards[2] = receive();

        int player = 0, next;
        while(true) {
            if(cards[player].length() == 0) break;
            next = cards[player].charAt(0) - 'a';
            cards[player] = cards[player].substring(1);
            player = next;
        }

        println((char)(player + 'A'));
        flush();
    }

    // array関連
    static BigInteger arraySum(BigInteger[] arr) {
        BigInteger ret = BigInteger.ZERO;
        for (BigInteger bi : arr)
            ret.add(bi);
        return ret;
    }

    static BigInteger arraySum(int[] arr) {
        BigInteger ret = BigInteger.ZERO;
        for (int i : arr)
            ret.add(BigInteger.valueOf(i));
        return ret;
    }

    // mod関連
    static BigInteger mod = BigInteger.valueOf((int) Math.pow(10, 9) + 7);

    // 数学関連
    static BigInteger gcd(BigInteger x, BigInteger y) {
        if (y.subtract(x).signum() > 0) {
            return gcd(y, x);
        }
        if (y.equals(BigInteger.ZERO)) {
            return x;
        }
        return gcd(y, x.remainder(y));
    }

    static BigInteger gcd(int x, int y) {
        return gcd(BigInteger.valueOf(x), BigInteger.valueOf(y));
    }

    static BigInteger lcm(int x, int y) {
        return lcm(BigInteger.valueOf(x), BigInteger.valueOf(y));
    }

    static BigInteger lcm(BigInteger x, BigInteger y) {
        return x.multiply(y).divide(gcd(x, y));
    }

    static BigInteger lcm(BigInteger[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (BigInteger i : arr) {
            lcm = lcm(lcm, i);
        }
        return lcm;
    }

    static BigInteger lcm(int[] arr) {
        BigInteger lcm = BigInteger.ONE;
        for (int i : arr) {
            lcm = lcm(lcm, BigInteger.valueOf(i));
        }
        return lcm;
    }

    static int powerOf2(int x) {
        int ret = 0;
        while (true) {
            if (x % 2 != 0)
                break;
            x /= 2;
            ret++;
        }
        return ret;
    }

    static int digits(int x) {
        int ret = 1;
        while (true) {
            if (x / 10 == 0)
                break;
            x /= 10;
            ret++;
        }
        return ret;
    }

    // 入出力関連
    static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static final PrintWriter pw = new PrintWriter(System.out);

    enum Delimiter {
        NONE(""), SPACE(" "), DOT("\\."), COMMA(",");

        private String regex;

        private Delimiter(String regex) {
            this.regex = regex;
        }

        public String getRegex() {
            return regex;
        }
    }

    static String receive() throws IOException {
        return br.readLine();
    }

    static int receiveInt() throws IOException {
        return Integer.parseInt(br.readLine());
    }

    static BigInteger receiveBigInteger() throws IOException {
        return new BigInteger(br.readLine());
    }

    static char receiveChar() throws IOException {
        return br.readLine().charAt(0);
    }

    static char[] receiveCharArray() throws IOException {
        return br.readLine().toCharArray();
    }

    static int[] receiveIntArray(Delimiter delimiter) throws IOException {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        int[] ret = new int[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = Integer.parseInt(inputs[i]);
        }
        return ret;
    }

    static BigInteger[] receiveBigIntegerArray(Delimiter delimiter) throws IOException {
        String[] inputs = br.readLine().split(delimiter.getRegex());
        BigInteger[] ret = new BigInteger[inputs.length];
        for (int i = 0; i < inputs.length; i++) {
            ret[i] = new BigInteger(inputs[i]);
        }
        return ret;
    }

    static String[] receiveStringArray(Delimiter delimiter) throws IOException {
        return br.readLine().split(delimiter.getRegex());
    }

    static void print(Object obj) {
        pw.print(obj);
    }

    static void println(Object obj) {
        pw.println(obj);
    }

    static void println() {
        pw.println("");
    }

    static void flush() {
        pw.flush();
    }
}