import java.util.regex.Matcher;
import java.util.regex.Pattern;
@SuppressWarnings("all")
public class Run2 {
public static void main(String[] args) {
Pattern p = Pattern.compile("a");
Matcher m = p.matcher("This is a text");
while(m.find()){
System.out.println(m.start(0));
System.out.println(m.end(0));
}
}
}