import java.util.*;
import java.util.regex.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String s = "abc:1234567,cd:2345678,efg:3456789012";
		Pattern pattern = Pattern.compile("\\b(?<!abc:)\\d{7}\\b");
		Matcher matcher = pattern.matcher(s);
		while (matcher.find()){
			System.out.println(matcher.group()); 
		} 
	}
}