print join '.', grep{s/ /-/g} map {sprintf("%03d", $_)} split(/\./, $foo);