import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Ab {
public static void main(String[] args) {
Pattern p=Pattern.compile("\\d+");
Matcher m=p.matcher("qw~~~12345~~~ee~~");
while(m.find())
{
System.out.println(m.group());
}
}
}