import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
publicclass Main {
publicstaticvoid main(String[] argv) throws Exception {
CharacterIterator it = new StringCharacterIterator("abcd");
// Iterate over the characters in the forward direction
for (char ch = it.first(); ch != CharacterIterator.DONE; ch = it.next()) {
System.out.println(ch);
}
}
}