#include <iostream>
using namespace std;
signed main() {
while (true) {
string s;
cin >> s;
if (s == "0")
break;
if (s.length() <= 4) {
cout << s << " : -\n";
continue;
}
int ans = 1;
for (int i = 2; i < s.length() - 2; i++)
ans *= s[i] - '0';
s += " : ";
cout << s << ans << "\n";
#include <iostream>
using namespace std;
signed main() {
while (true) {
string s;
cin >> s;
if (s == "0")
break;
if (s.length() <= 4) {
cout << s << " : -\n";
continue;
}
int ans = 1;
for (int i = 2; i < s.length() - 2; i++)
ans *= s[i] - '0';
s += " : ";
cout << s << ans << "\n";
}
}