// Arup Guha
// 4/28/2018
// Solution to 2016 AP Computer Science FRQ Question 1B - RandomLetterChooser

import java.util.*;

public class RandomLetterChooser extends RandomStringChooser {

	public RandomLetterChooser(String word) {
		super(getSingleLetters(word));
	}

	// Returns each letter of str in a string array (one letter as a string) per string.
	public static String[] getSingleLetters(String str) {
		String[] res = new String[str.length()];
		for (int i=0; i<str.length(); i++)
			res[i] = str.substring(i, i+1);
		return res;
	}

	// A little test.
	public static void main(String[] args) {
		RandomLetterChooser mine = new RandomLetterChooser("category");
		for (int i=0; i<10; i++)
			System.out.print(mine.getNext()+" ");
		System.out.println();
	}
}