import java.util.regex.*;
public class PatternIP {
public static void main(String[] args) {
Pattern p = Pattern
.compile("(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})");
Matcher m = p.matcher(args[0]);
for (int nb=0; m.find(); ++nb) {
try {
int[] octets = new int [4];
int i;
for (i=0; i<4; ++i) {
octets[i] = Integer.parseInt(m.group(i+1));
if (octets[i]>255) break;
}
if (i==4) System.out.println(octets[0] + "." + octets[1] + "." +
octets[2] + "." + octets[3]);
} catch (NumberFormatException e) {} }
}
}