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

public class Main{

	public static void main(String[] args) {
		InputReader scn = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		String s1 = scn.next(), s2 = scn.next(), s3 = scn.next();
		int u = 0, v = 0, w = 0, player = 1;
		char ch1, ch2, ch3;
		while (true) {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		}
		out.close();
	}

	public static HashMap<String, Integer> CountFrequencies(String[] arr) {
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		}

//		for (String val : map.keySet()) {
//			String val1 = val;
//			int val2 = map.get(val);
//			if (val2 % 2 != 0) {
//				return false;
//			}
//		}
		return map;
	}

	public static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static int lcm(int a, int b) {
		return (a * b) / gcd(a, b);
	}

	public static ArrayList<String> GetSubSequences(String s) {
		if (s.length() == 0) {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		}
		char ch = s.charAt(0);
		String ms = s.substring(1);

		ArrayList<String> rr = GetSubSequences(ms);

		ArrayList<String> mr = new ArrayList<>();

		int t = rr.size();
		for (int i = 0; i < t; i++) {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		}

		return mr;

	}

	public static int binarySearch(int arr[], int l, int r, int x) {
		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		}
		return -1;
	}

	public static int firstOccurence(int array1[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		}
		return -1;
	}

	public static int lastOccurence(int array2[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		}
		return -1;
	}

	public static boolean isPrime(long n) {
		if (n < 2)
			return false;
		if (n == 2 || n == 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sqrtN = (int) Math.sqrt(n) + 1;
		for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		}
		return true;
	}

	public static void quickSort(int[] arr, int lo, int hi) {
		if (lo >= hi) {
			return;
		}
		int mid = (lo + hi) / 2;
		int pivot = arr[mid];
		int left = lo;
		int right = hi;
		while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		}
		quickSort(arr, lo, right);
		quickSort(arr, left, hi);
	}

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

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

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

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

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

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

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return nextLine();
		}

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

	static 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(1);
				}
				writer.print(objects[i]);
			}
		}

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

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

} import java.io.*; io.* java import java.util.*; util.* java public class Main{

	public static void main(String[] args) {
		InputReader scn = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		String s1 = scn.next(), s2 = scn.next(), s3 = scn.next();
		int u = 0, v = 0, w = 0, player = 1;
		char ch1, ch2, ch3;
		while (true) {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		}
		out.close();
	}

	public static HashMap<String, Integer> CountFrequencies(String[] arr) {
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		}

//		for (String val : map.keySet()) {
//			String val1 = val;
//			int val2 = map.get(val);
//			if (val2 % 2 != 0) {
//				return false;
//			}
//		}
		return map;
	}

	public static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static int lcm(int a, int b) {
		return (a * b) / gcd(a, b);
	}

	public static ArrayList<String> GetSubSequences(String s) {
		if (s.length() == 0) {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		}
		char ch = s.charAt(0);
		String ms = s.substring(1);

		ArrayList<String> rr = GetSubSequences(ms);

		ArrayList<String> mr = new ArrayList<>();

		int t = rr.size();
		for (int i = 0; i < t; i++) {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		}

		return mr;

	}

	public static int binarySearch(int arr[], int l, int r, int x) {
		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		}
		return -1;
	}

	public static int firstOccurence(int array1[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		}
		return -1;
	}

	public static int lastOccurence(int array2[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		}
		return -1;
	}

	public static boolean isPrime(long n) {
		if (n < 2)
			return false;
		if (n == 2 || n == 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sqrtN = (int) Math.sqrt(n) + 1;
		for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		}
		return true;
	}

	public static void quickSort(int[] arr, int lo, int hi) {
		if (lo >= hi) {
			return;
		}
		int mid = (lo + hi) / 2;
		int pivot = arr[mid];
		int left = lo;
		int right = hi;
		while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		}
		quickSort(arr, lo, right);
		quickSort(arr, left, hi);
	}

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

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

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

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

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

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

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return nextLine();
		}

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

	static 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(1);
				}
				writer.print(objects[i]);
			}
		}

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

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

} Main public static void main(String[] args) {
		InputReader scn = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		String s1 = scn.next(), s2 = scn.next(), s3 = scn.next();
		int u = 0, v = 0, w = 0, player = 1;
		char ch1, ch2, ch3;
		while (true) {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		}
		out.close();
	} main {
		InputReader scn = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		String s1 = scn.next(), s2 = scn.next(), s3 = scn.next();
		int u = 0, v = 0, w = 0, player = 1;
		char ch1, ch2, ch3;
		while (true) {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		}
		out.close();
	} InputReader scn = new InputReader(System.in); scn new InputReader(System.in) OutputWriter out = new OutputWriter(System.out); out new OutputWriter(System.out) String s1 = scn.next() s1 scn.next() scn.next scn s2 = scn.next() s2 scn.next() scn.next scn s3 = scn.next(); s3 scn.next() scn.next scn int u = 0 u 0 v = 0 v 0 w = 0 w 0 player = 1; player 1 char ch1 ch1 ch2 ch2 ch3; ch3 while (true) {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		} true {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		} if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			} player == 1 player 1 {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			} if (u == s1.length()) {
					out.println("A");
					break;
				} u == s1.length() u s1.length() s1.length s1 {
					out.println("A");
					break;
				} out.println("A") out.println out "A" break; ch1 = s1.charAt(u) ch1 s1.charAt(u) s1.charAt s1 u u++ u if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3; ch1 == 'a' ch1 'a' {
					player = 1;
				} player = 1 player 1 if (ch1 == 'b')
					player = 2;
				else
					player = 3; ch1 == 'b' ch1 'b' player = 2 player 2 player = 3 player 3 if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			} player == 2 player 2 {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			} if (v == s2.length()) {
					out.println("B");
					break;
				} v == s2.length() v s2.length() s2.length s2 {
					out.println("B");
					break;
				} out.println("B") out.println out "B" break; ch2 = s2.charAt(v) ch2 s2.charAt(v) s2.charAt s2 v v++ v if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3; ch2 == 'a' ch2 'a' {
					player = 1;
				} player = 1 player 1 if (ch2 == 'b')
					player = 2;
				else
					player = 3; ch2 == 'b' ch2 'b' player = 2 player 2 player = 3 player 3 if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			} player == 3 player 3 {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			} if (w == s3.length()) {
					out.println("C");
					break;
				} w == s3.length() w s3.length() s3.length s3 {
					out.println("C");
					break;
				} out.println("C") out.println out "C" break; ch3 = s3.charAt(w) ch3 s3.charAt(w) s3.charAt s3 w w++ w if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3; ch3 == 'a' ch3 'a' {
					player = 1;
				} player = 1 player 1 if (ch3 == 'b')
					player = 2;
				else
					player = 3; ch3 == 'b' ch3 'b' player = 2 player 2 player = 3 player 3 out.close() out.close out String[] args args public static HashMap<String, Integer> CountFrequencies(String[] arr) {
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		}

//		for (String val : map.keySet()) {
//			String val1 = val;
//			int val2 = map.get(val);
//			if (val2 % 2 != 0) {
//				return false;
//			}
//		}
		return map;
	} CountFrequencies {
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		}

//		for (String val : map.keySet()) {
//			String val1 = val;
//			int val2 = map.get(val);
//			if (val2 % 2 != 0) {
//				return false;
//			}
//		}
		return map;
	} HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < arr.length; i++) {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		} {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		} String a = arr[i]; a arr[i] arr i if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			} map.containsKey(a) map.containsKey map a {
				map.put(a, map.get(a) + 1);
			} map.put(a, map.get(a) + 1) map.put map a map.get(a) + 1 map.get(a) map.get map a 1 {
				map.put(a, 1);
			} map.put(a, 1) map.put map a 1 return map; map String[] arr arr public static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	} gcd {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	} if (a == 0)
			return b; a == 0 a 0 return b; b return gcd(b % a, a); gcd(b % a, a) gcd b % a b a a int a a int b b public static int lcm(int a, int b) {
		return (a * b) / gcd(a, b);
	} lcm {
		return (a * b) / gcd(a, b);
	} return (a * b) / gcd(a, b); (a * b) / gcd(a, b) (a * b) a b gcd(a, b) gcd a b int a a int b b public static ArrayList<String> GetSubSequences(String s) {
		if (s.length() == 0) {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		}
		char ch = s.charAt(0);
		String ms = s.substring(1);

		ArrayList<String> rr = GetSubSequences(ms);

		ArrayList<String> mr = new ArrayList<>();

		int t = rr.size();
		for (int i = 0; i < t; i++) {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		}

		return mr;

	} GetSubSequences {
		if (s.length() == 0) {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		}
		char ch = s.charAt(0);
		String ms = s.substring(1);

		ArrayList<String> rr = GetSubSequences(ms);

		ArrayList<String> mr = new ArrayList<>();

		int t = rr.size();
		for (int i = 0; i < t; i++) {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		}

		return mr;

	} if (s.length() == 0) {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		} s.length() == 0 s.length() s.length s 0 {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		} ArrayList<String> br = new ArrayList<>(); br new ArrayList<>() br.add("") br.add br "" return br; br char ch = s.charAt(0); ch s.charAt(0) s.charAt s 0 String ms = s.substring(1); ms s.substring(1) s.substring s 1 ArrayList<String> rr = GetSubSequences(ms); rr GetSubSequences(ms) GetSubSequences ms ArrayList<String> mr = new ArrayList<>(); mr new ArrayList<>() int t = rr.size(); t rr.size() rr.size rr for (int i = 0; i < t; i++) {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		} int i = 0; int i = 0; i 0 i < t i t i++ i++ i {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		} {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		} mr.add(rr.get(i)) mr.add mr rr.get(i) rr.get rr i mr.add(ch + rr.get(i)) mr.add mr ch + rr.get(i) ch rr.get(i) rr.get rr i return mr; mr String s s public static int binarySearch(int arr[], int l, int r, int x) {
		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		}
		return -1;
	} binarySearch {
		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		}
		return -1;
	} if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		} r >= l r l {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		} int mid = l + (r - l) / 2; mid l + (r - l) / 2 l (r - l) / 2 (r - l) r l 2 if (arr[mid] == x)
				return mid; arr[mid] == x arr[mid] arr mid x return mid; mid if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x); arr[mid] > x arr[mid] arr mid x return binarySearch(arr, l, mid - 1, x); binarySearch(arr, l, mid - 1, x) binarySearch arr l mid - 1 mid 1 x return binarySearch(arr, mid + 1, r, x); binarySearch(arr, mid + 1, r, x) binarySearch arr mid + 1 mid 1 r x return -1; -1 1 int arr[] arr int l l int r r int x x public static int firstOccurence(int array1[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		}
		return -1;
	} firstOccurence {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		}
		return -1;
	} if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		} low <= high low high {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		} int mid = low + (high - low) / 2; mid low + (high - low) / 2 low (high - low) / 2 (high - low) high low 2 if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n); (mid == 0 || x > array1[mid - 1]) && array1[mid] == x (mid == 0 || x > array1[mid - 1]) mid == 0 mid 0 x > array1[mid - 1] x array1[mid - 1] array1 mid - 1 mid 1 array1[mid] == x array1[mid] array1 mid x return mid; mid if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n); x > array1[mid] x array1[mid] array1 mid return firstOccurence(array1, (mid + 1), high, x, n); firstOccurence(array1, (mid + 1), high, x, n) firstOccurence array1 (mid + 1) mid 1 high x n return firstOccurence(array1, low, (mid - 1), x, n); firstOccurence(array1, low, (mid - 1), x, n) firstOccurence array1 low (mid - 1) mid 1 x n return -1; -1 1 int array1[] array1 int low low int high high int x x int n n public static int lastOccurence(int array2[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		}
		return -1;
	} lastOccurence {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		}
		return -1;
	} if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		} low <= high low high {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		} int mid = low + (high - low) / 2; mid low + (high - low) / 2 low (high - low) / 2 (high - low) high low 2 if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n); (mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x (mid == n - 1 || x < array2[mid + 1]) mid == n - 1 mid n - 1 n 1 x < array2[mid + 1] x array2[mid + 1] array2 mid + 1 mid 1 array2[mid] == x array2[mid] array2 mid x return mid; mid if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n); x < array2[mid] x array2[mid] array2 mid return lastOccurence(array2, low, (mid - 1), x, n); lastOccurence(array2, low, (mid - 1), x, n) lastOccurence array2 low (mid - 1) mid 1 x n return lastOccurence(array2, (mid + 1), high, x, n); lastOccurence(array2, (mid + 1), high, x, n) lastOccurence array2 (mid + 1) mid 1 high x n return -1; -1 1 int array2[] array2 int low low int high high int x x int n n public static boolean isPrime(long n) {
		if (n < 2)
			return false;
		if (n == 2 || n == 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sqrtN = (int) Math.sqrt(n) + 1;
		for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		}
		return true;
	} isPrime {
		if (n < 2)
			return false;
		if (n == 2 || n == 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sqrtN = (int) Math.sqrt(n) + 1;
		for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		}
		return true;
	} if (n < 2)
			return false; n < 2 n 2 return false; false if (n == 2 || n == 3)
			return true; n == 2 || n == 3 n == 2 n 2 n == 3 n 3 return true; true if (n % 2 == 0 || n % 3 == 0)
			return false; n % 2 == 0 || n % 3 == 0 n % 2 == 0 n % 2 n 2 0 n % 3 == 0 n % 3 n 3 0 return false; false long sqrtN = (int) Math.sqrt(n) + 1; sqrtN (int) Math.sqrt(n) + 1 (int) Math.sqrt(n) Math.sqrt Math n 1 for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		} long i = 6L; long i = 6L; i 6L i <= sqrtN i sqrtN i += 6 i += 6 i 6 {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		} {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		} if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false; n % (i - 1) == 0 || n % (i + 1) == 0 n % (i - 1) == 0 n % (i - 1) n (i - 1) i 1 0 n % (i + 1) == 0 n % (i + 1) n (i + 1) i 1 0 return false; false return true; true long n n public static void quickSort(int[] arr, int lo, int hi) {
		if (lo >= hi) {
			return;
		}
		int mid = (lo + hi) / 2;
		int pivot = arr[mid];
		int left = lo;
		int right = hi;
		while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		}
		quickSort(arr, lo, right);
		quickSort(arr, left, hi);
	} quickSort {
		if (lo >= hi) {
			return;
		}
		int mid = (lo + hi) / 2;
		int pivot = arr[mid];
		int left = lo;
		int right = hi;
		while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		}
		quickSort(arr, lo, right);
		quickSort(arr, left, hi);
	} if (lo >= hi) {
			return;
		} lo >= hi lo hi {
			return;
		} return; int mid = (lo + hi) / 2; mid (lo + hi) / 2 (lo + hi) lo hi 2 int pivot = arr[mid]; pivot arr[mid] arr mid int left = lo; left lo int right = hi; right hi while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		} left <= right left right {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		} while (arr[left] < pivot) {
				left++;
			} arr[left] < pivot arr[left] arr left pivot {
				left++;
			} left++ left while (arr[right] > pivot) {
				right--;
			} arr[right] > pivot arr[right] arr right pivot {
				right--;
			} right-- right if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			} left <= right left right {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			} int temp = arr[left]; temp arr[left] arr left arr[left] = arr[right] arr[left] arr left arr[right] arr right arr[right] = temp arr[right] arr right temp left++ left right-- right quickSort(arr, lo, right) quickSort arr lo right quickSort(arr, left, hi) quickSort arr left hi int[] arr arr int lo lo int hi hi static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

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

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

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

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

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

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return nextLine();
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	} InputReader private InputStream stream; stream private byte[] buf = new byte[1024]; buf new byte[1024] 1024 private int curChar; curChar private int numChars; numChars private SpaceCharFilter filter; filter public InputReader(InputStream stream) {
			this.stream = stream;
		} InputReader {
			this.stream = stream;
		} this.stream = stream this.stream this this.stream stream InputStream 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++];
		} read {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		} if (numChars == -1)
				throw new InputMismatchException(); numChars == -1 numChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			} curChar >= numChars curChar numChars {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			} curChar = 0 curChar 0 try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				} catch (IOException e) {
					throw new InputMismatchException();
				} IOException e {
					throw new InputMismatchException();
				} throw new InputMismatchException(); new InputMismatchException() {
					numChars = stream.read(buf);
				} numChars = stream.read(buf) numChars stream.read(buf) stream.read stream buf if (numChars <= 0)
					return -1; numChars <= 0 numChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		} nextInt {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		} int c = read(); c read() read while (isSpaceChar(c))
				c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
				sgn = -1;
				c = read();
			} c == '-' c '-' {
				sgn = -1;
				c = read();
			} sgn = -1 sgn -1 1 c = read() c read() read int res = 0; res 0 do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} if (c < '0' || c > '9')
					throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		} nextLong {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		} int c = read(); c read() read while (isSpaceChar(c))
				c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read int sgn = 1; sgn 1 if (c == '-') {
				sgn = -1;
				c = read();
			} c == '-' c '-' {
				sgn = -1;
				c = read();
			} sgn = -1 sgn -1 1 c = read() c read() read long res = 0; res 0 do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} if (c < '0' || c > '9')
					throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = read() c read() read return res * sgn; res * sgn res sgn public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		} nextLine {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		} int c = read(); c read() read while (isSpaceChar(c))
				c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
				res.appendCodePoint(c);
				c = read();
			} res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		} isSpaceChar {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		} if (filter != null)
				return filter.isSpaceChar(c); filter != null filter null return filter.isSpaceChar(c); filter.isSpaceChar(c) filter.isSpaceChar filter c return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c public String next() {
			return nextLine();
		} next {
			return nextLine();
		} return nextLine(); nextLine() nextLine public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		} SpaceCharFilter public boolean isSpaceChar(int ch); isSpaceChar int ch ch static 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(1);
				}
				writer.print(objects[i]);
			}
		}

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

		public void close() {
			writer.close();
		}
	} OutputWriter private final PrintWriter writer; writer public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		} OutputWriter {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		} writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream))) writer new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream))) OutputStream outputStream outputStream public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		} OutputWriter {
			this.writer = new PrintWriter(writer);
		} this.writer = new PrintWriter(writer) this.writer this this.writer new PrintWriter(writer) Writer writer writer public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0) {
					writer.print(' ');
//                    writer.print(1);
				}
				writer.print(objects[i]);
			}
		} print {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0) {
					writer.print(' ');
//                    writer.print(1);
				}
				writer.print(objects[i]);
			}
		} for (int i = 0; i < objects.length; i++) {
				if (i != 0) {
					writer.print(' ');
//                    writer.print(1);
				}
				writer.print(objects[i]);
			} int i = 0; int i = 0; i 0 i < objects.length i objects.length objects objects.length i++ i++ i {
				if (i != 0) {
					writer.print(' ');
//                    writer.print(1);
				}
				writer.print(objects[i]);
			} {
				if (i != 0) {
					writer.print(' ');
//                    writer.print(1);
				}
				writer.print(objects[i]);
			} if (i != 0) {
					writer.print(' ');
//                    writer.print(1);
				} i != 0 i 0 {
					writer.print(' ');
//                    writer.print(1);
				} writer.print(' ') writer.print writer ' ' writer.print(objects[i]) writer.print writer objects[i] objects i Object... objects objects public void println(Object... objects) {
			print(objects);
			writer.println();
		} println {
			print(objects);
			writer.println();
		} print(objects) print objects writer.println() writer.println writer Object... objects objects public void close() {
			writer.close();
		} close {
			writer.close();
		} writer.close() writer.close writer public class Main{

	public static void main(String[] args) {
		InputReader scn = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		String s1 = scn.next(), s2 = scn.next(), s3 = scn.next();
		int u = 0, v = 0, w = 0, player = 1;
		char ch1, ch2, ch3;
		while (true) {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		}
		out.close();
	}

	public static HashMap<String, Integer> CountFrequencies(String[] arr) {
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		}

//		for (String val : map.keySet()) {
//			String val1 = val;
//			int val2 = map.get(val);
//			if (val2 % 2 != 0) {
//				return false;
//			}
//		}
		return map;
	}

	public static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static int lcm(int a, int b) {
		return (a * b) / gcd(a, b);
	}

	public static ArrayList<String> GetSubSequences(String s) {
		if (s.length() == 0) {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		}
		char ch = s.charAt(0);
		String ms = s.substring(1);

		ArrayList<String> rr = GetSubSequences(ms);

		ArrayList<String> mr = new ArrayList<>();

		int t = rr.size();
		for (int i = 0; i < t; i++) {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		}

		return mr;

	}

	public static int binarySearch(int arr[], int l, int r, int x) {
		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		}
		return -1;
	}

	public static int firstOccurence(int array1[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		}
		return -1;
	}

	public static int lastOccurence(int array2[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		}
		return -1;
	}

	public static boolean isPrime(long n) {
		if (n < 2)
			return false;
		if (n == 2 || n == 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sqrtN = (int) Math.sqrt(n) + 1;
		for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		}
		return true;
	}

	public static void quickSort(int[] arr, int lo, int hi) {
		if (lo >= hi) {
			return;
		}
		int mid = (lo + hi) / 2;
		int pivot = arr[mid];
		int left = lo;
		int right = hi;
		while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		}
		quickSort(arr, lo, right);
		quickSort(arr, left, hi);
	}

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

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

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

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

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

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

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return nextLine();
		}

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

	static 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(1);
				}
				writer.print(objects[i]);
			}
		}

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

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

} public class Main{

	public static void main(String[] args) {
		InputReader scn = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		String s1 = scn.next(), s2 = scn.next(), s3 = scn.next();
		int u = 0, v = 0, w = 0, player = 1;
		char ch1, ch2, ch3;
		while (true) {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		}
		out.close();
	}

	public static HashMap<String, Integer> CountFrequencies(String[] arr) {
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		}

//		for (String val : map.keySet()) {
//			String val1 = val;
//			int val2 = map.get(val);
//			if (val2 % 2 != 0) {
//				return false;
//			}
//		}
		return map;
	}

	public static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static int lcm(int a, int b) {
		return (a * b) / gcd(a, b);
	}

	public static ArrayList<String> GetSubSequences(String s) {
		if (s.length() == 0) {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		}
		char ch = s.charAt(0);
		String ms = s.substring(1);

		ArrayList<String> rr = GetSubSequences(ms);

		ArrayList<String> mr = new ArrayList<>();

		int t = rr.size();
		for (int i = 0; i < t; i++) {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		}

		return mr;

	}

	public static int binarySearch(int arr[], int l, int r, int x) {
		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		}
		return -1;
	}

	public static int firstOccurence(int array1[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		}
		return -1;
	}

	public static int lastOccurence(int array2[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		}
		return -1;
	}

	public static boolean isPrime(long n) {
		if (n < 2)
			return false;
		if (n == 2 || n == 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sqrtN = (int) Math.sqrt(n) + 1;
		for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		}
		return true;
	}

	public static void quickSort(int[] arr, int lo, int hi) {
		if (lo >= hi) {
			return;
		}
		int mid = (lo + hi) / 2;
		int pivot = arr[mid];
		int left = lo;
		int right = hi;
		while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		}
		quickSort(arr, lo, right);
		quickSort(arr, left, hi);
	}

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

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

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

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

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

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

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return nextLine();
		}

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

	static 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(1);
				}
				writer.print(objects[i]);
			}
		}

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

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

} Main
import java.io.*;
import java.util.*;

public class Main{

	public static void main(String[] args) {
		InputReader scn = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		String s1 = scn.next(), s2 = scn.next(), s3 = scn.next();
		int u = 0, v = 0, w = 0, player = 1;
		char ch1, ch2, ch3;
		while (true) {
			if (player == 1) {
				if (u == s1.length()) {
					out.println("A");
					break;
				}
				ch1 = s1.charAt(u);
				u++;
				if (ch1 == 'a') {
					player = 1;
				} else if (ch1 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 2) {
				if (v == s2.length()) {
					out.println("B");
					break;
				}
				ch2 = s2.charAt(v);
				v++;
				if (ch2 == 'a') {
					player = 1;
				} else if (ch2 == 'b')
					player = 2;
				else
					player = 3;
			}
			if (player == 3) {
				if (w == s3.length()) {
					out.println("C");
					break;
				}
				ch3 = s3.charAt(w);
				w++;
				if (ch3 == 'a') {
					player = 1;
				} else if (ch3 == 'b')
					player = 2;
				else
					player = 3;
			}
		}
		out.close();
	}

	public static HashMap<String, Integer> CountFrequencies(String[] arr) {
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			String a = arr[i];
			if (map.containsKey(a)) {
				map.put(a, map.get(a) + 1);
			} else {
				map.put(a, 1);
			}
		}

//		for (String val : map.keySet()) {
//			String val1 = val;
//			int val2 = map.get(val);
//			if (val2 % 2 != 0) {
//				return false;
//			}
//		}
		return map;
	}

	public static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static int lcm(int a, int b) {
		return (a * b) / gcd(a, b);
	}

	public static ArrayList<String> GetSubSequences(String s) {
		if (s.length() == 0) {
			ArrayList<String> br = new ArrayList<>();
			br.add("");
			return br;
		}
		char ch = s.charAt(0);
		String ms = s.substring(1);

		ArrayList<String> rr = GetSubSequences(ms);

		ArrayList<String> mr = new ArrayList<>();

		int t = rr.size();
		for (int i = 0; i < t; i++) {
			mr.add(rr.get(i));
			mr.add(ch + rr.get(i));

		}

		return mr;

	}

	public static int binarySearch(int arr[], int l, int r, int x) {
		if (r >= l) {
			int mid = l + (r - l) / 2;
			if (arr[mid] == x)
				return mid;
			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);
			return binarySearch(arr, mid + 1, r, x);
		}
		return -1;
	}

	public static int firstOccurence(int array1[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == 0 || x > array1[mid - 1]) && array1[mid] == x)
				return mid;
			else if (x > array1[mid])
				return firstOccurence(array1, (mid + 1), high, x, n);
			else
				return firstOccurence(array1, low, (mid - 1), x, n);
		}
		return -1;
	}

	public static int lastOccurence(int array2[], int low, int high, int x, int n) {
		if (low <= high) {
			int mid = low + (high - low) / 2;
			if ((mid == n - 1 || x < array2[mid + 1]) && array2[mid] == x)
				return mid;
			else if (x < array2[mid])
				return lastOccurence(array2, low, (mid - 1), x, n);
			else
				return lastOccurence(array2, (mid + 1), high, x, n);
		}
		return -1;
	}

	public static boolean isPrime(long n) {
		if (n < 2)
			return false;
		if (n == 2 || n == 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sqrtN = (int) Math.sqrt(n) + 1;
		for (long i = 6L; i <= sqrtN; i += 6) {
			if (n % (i - 1) == 0 || n % (i + 1) == 0)
				return false;
		}
		return true;
	}

	public static void quickSort(int[] arr, int lo, int hi) {
		if (lo >= hi) {
			return;
		}
		int mid = (lo + hi) / 2;
		int pivot = arr[mid];
		int left = lo;
		int right = hi;
		while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		}
		quickSort(arr, lo, right);
		quickSort(arr, left, hi);
	}

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

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

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

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

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

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

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return nextLine();
		}

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

	static 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(1);
				}
				writer.print(objects[i]);
			}
		}

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

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

}
