/* package whatever; // don't place package name! */
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Pattern pat = Pattern.compile( ".*a.*?b.*" );
boolean b;
Matcher m = pat.matcher( text );
long t1
= System.
currentTimeMillis(); for ( int i=0; i<500000; i++ ) {
b = m.matches();
}
long t2
= System.
currentTimeMillis(); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC5yZWdleC5QYXR0ZXJuOwppbXBvcnQgamF2YS51dGlsLnJlZ2V4Lk1hdGNoZXI7CmltcG9ydCBqYXZhLmxhbmcuKjsKaW1wb3J0IGphdmEuaW8uKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJUGF0dGVybiBwYXQgPSBQYXR0ZXJuLmNvbXBpbGUoICIuKmEuKj9iLioiICk7CgkJYm9vbGVhbiBiOwoJCVN0cmluZyB0ZXh0ID0gIiAgICAgICAgICAgICBhICAgICAgICAgICAgICAgICAgICAgIGIgICAgICAgICAgICAgICAgICAgICAgIjsKCQlNYXRjaGVyIG0gPSBwYXQubWF0Y2hlciggdGV4dCApOwoJCWxvbmcgdDEgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKCQlmb3IgKCBpbnQgaT0wOyBpPDUwMDAwMDsgaSsrICkgewoJCQliID0gbS5tYXRjaGVzKCk7CgkJfQoJCWxvbmcgdDIgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKCQlTeXN0ZW0ub3V0LnByaW50KCB0MiAtIHQxICkgOwoJfQp9