#include <iostream>
#include <array>
#include <algorithm>
#include <cmath>
#include <vector>
struct Point
{
int x;
int y;
};
std::ostream& operator<<(std::ostream& out, const Point& p)
{
return out << p.x << ':' << p.y;
}
double euclidianDistance(const Point& p1, const Point& p2, int width, bool wraparound)
{
if(!wraparound)
return std::sqrt(std::pow(p1.x - p2.x, 2) + std::pow(p1.y - p2.y, 2));
return std::sqrt(std::pow(width - p2.x + p1.x, 2) + std::pow(p1.y - p2.y, 2));
}
int main()
{
std::vector<Point> land;
std::vector<Point> sea;
std::string line;
int width, height;
std::cin >> width >> height;
int y = 0;
getline(std::cin, line);
while(getline(std::cin, line))
{
while(line.length() < width)
line += " ";
for(int x = 0; x < line.length(); x++)
{
if(line[x] == '#')
land.push_back({x, y});
else
sea.push_back({x, y});
}
y++;
}
double largest_distance = 0;
Point nemo;
for(const Point& s: sea)
{
double closest_land = 1000000;
for(const Point& l: land)
{
std::array<double, 4> distances {
euclidianDistance(s, l, width, false),
euclidianDistance(s, l, width, true),
euclidianDistance(l, s, width, false),
euclidianDistance(l, s, width, true)
};
double distance = *(std::min_element(distances.begin(), distances.end()));
if(distance < closest_land)
closest_land = distance;
}
if(closest_land > largest_distance)
{
nemo = s;
largest_distance = closest_land;
}
}
std::cout << nemo << " : " << largest_distance << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoJI2luY2x1ZGUgPGFycmF5PgoJI2luY2x1ZGUgPGFsZ29yaXRobT4KCSNpbmNsdWRlIDxjbWF0aD4KCSNpbmNsdWRlIDx2ZWN0b3I+CgoJc3RydWN0IFBvaW50Cgl7CgkJaW50IHg7CgkJaW50IHk7Cgl9OwoKCXN0ZDo6b3N0cmVhbSYgb3BlcmF0b3I8PChzdGQ6Om9zdHJlYW0mIG91dCwgY29uc3QgUG9pbnQmIHApCgl7CgkJcmV0dXJuIG91dCA8PCBwLnggPDwgJzonIDw8IHAueTsKCX0KCglkb3VibGUgZXVjbGlkaWFuRGlzdGFuY2UoY29uc3QgUG9pbnQmI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gICAgICAgICAgIyMjICMjICAjIyMjICMjIyMgICMjCiAgICAgIyMjIyMjIyMjICMjIyMjIyMjIyAgICAgICAgICMjIyAgICAgICAgICAgICMjICAjICAgIyMjICMjICAgIyMKIyAgICAgIyAjIyMjIyAgICMjIyMjIyMgICAgICAgICAjIyMgICAgICAgICAgICAgICAgICAgICAgIyAgICAgICMKICAgICAgIyAgICMjIyAgICAgICAjIyAgICAgICAgICAgICAgICAgICAgICAgICAgIyMjIyMjIyAKICAgICAgIyAgICAjIyMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIyMjIyMjIyMjIyAgICAgIwogICAgICAgICAgICAjIyMgICAjIyAgICAgICAgICAgICAgICAgICAgICAgICAgIyMjIyMjIyMjIyMjIyMgICAgICAgICAgICAgICMKIyAgICAgICAgICAgICMjIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyMjIyMjIyMjICAgICAgICAgICAgICAgICMKICAgICAgICAgICAgICAjIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIyMjIyMjIyMjIyMjCiAgICAgICAgICAgICMjIyMjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyMjIyMjICAgICAgICMjCiAgICAgICAgICAjIyMjIyMjIyMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyMjIyMgICAgICAjIwogICAgICAgICMjIyMjIyMjIyMjIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyMjIyAgICAgIyMKICAgICAgIyMjIyMjIyMjIyMjIyMjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyMjIyMjIwogICAgICMjIyMjIyMjIyMjIyMjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyMjIyMgICAgICAgICAgICMjIyMjIyMjIwogICAgIyMjIyMjIyMjIyMjIyMjICMjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMjIyAgICAgICAgICAgIyMjIyMjIyMjIyMKICAgICAjIyMjIyMjIyMjIyMjIyMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyAgICAgICAgICAgIyMjIyMjIyMjIyMjCiAgICAgICMjIyMjIyMjIyMjIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMjIyAgICMjIyMKICAgICAgICMjIyMjIyMjIyAgICAgICMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAojICAgICAgICAgIyMjIyMKCiAgICAgICAgICAjIyMjIyMjIyAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyAgICAgICAgICAgICAgICMjIyMjIyMKICAgICAgICAjIyMjIyMjIyMjIyMjIyMjIyMjIyMjICMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyAgIyMjIyMjIyMjIyMjIyMKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
80 25
## # # # # # # ## ###
#### ###### ######## ###### ##### ######### #### #######
########## ## ##### #### # #####################
####################### ## ### ## #### #### ##
######### ######### ### ## # ### ## ##
# # ##### ####### ### # #
# ### ## #######
# ### ########### #
### ## ############## #
# ### ############## #
## #############
##### ########### ##
######### ########## ##
############ ######### ##
############### #######
############## ##### #########
############### ## ### ###########
############### # ############
############ ### ####
######### #
# #####
######## ###### #######
###################### ########################### ##############
##############################################################################