#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
string input;
string tmp;
vector <string> num_vec;
int max_len = 0;
int last_len = 0;
string max_string;
while (cin >> input) {
tmp.clear();
num_vec.clear();
max_len = 0;
max_string.clear();
for (int i = 0; i < input.size(); i++) {
if (input[i] == '.') {
if (tmp.size() == 0) {
continue;
} else if (tmp.size() > 0) {
if (tmp[tmp.size() - 1] == '.') {
num_vec.push_back(tmp);
tmp.clear();
}
else {
tmp += input[i];
}
}
}
else if ((input[i] >= '0' && input[i] <= '9')) {
tmp += input[i];
}
else {
if (tmp.size() > 0) {
num_vec.push_back(tmp);
}
tmp.clear();
}
}
if (tmp.size() > 0) {
num_vec.push_back(tmp);
}
tmp.clear();
for (int j = 0; j < num_vec.size(); j++) {
tmp = num_vec[j];
if (tmp[0] == '.')
tmp = tmp.substr(1);
if (tmp[tmp.size() - 1] == '.')
tmp = tmp.substr(0, tmp.size() - 1);
if (tmp.find('.') == string::npos) {
if (tmp.size() > max_len) {
max_len = tmp.size();
max_string = tmp;
}
}
else {
tmp += '.';
string elem;
vector <string> elem_vec;
elem.clear();
for (int m = 0; m < tmp.size(); m++) {
if (tmp[m] == '.') {
elem_vec.push_back(elem);
elem.clear();
}
else {
elem += tmp[m];
}
}
for (int n = 1; n < elem_vec.size(); n++) {
if ((elem_vec[n].size() + elem_vec[n - 1].size() + 1) >= max_len) {
max_len = (elem_vec[n].size() + elem_vec[n - 1].size() + 1);
max_string = (elem_vec[n - 1] + '.' + elem_vec[n]);
}
}
elem_vec.clear();
}
}
//cout << max_len << endl;
cout << max_string << endl;
cout << "-----------------------------------" << endl;
}
}