import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
public class Main
{
public static void main
(String[] args
) {
Scanner in
= new Scanner
(System.
in); s = s.replaceAll(" +", " ");
if(s.charAt(0) == ' ')
{
s = s.substring(1, s.length());
}
if(s.charAt(s.length()-1) == ' ')
{
s = s.substring(0, s.length()-1);
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKCnB1YmxpYyBjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpCgl7CgkJU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJU3RyaW5nIHMgPSBpbi5uZXh0TGluZSgpOwoJCXMgPSBzLnJlcGxhY2VBbGwoIiArIiwgIiAiKTsKICAgICAgICBpZihzLmNoYXJBdCgwKSA9PSAnICcpIAoJICAgIHsKCSAgICAgICAgICBzID0gcy5zdWJzdHJpbmcoMSwgcy5sZW5ndGgoKSk7CgkgICAgfQoJCWlmKHMuY2hhckF0KHMubGVuZ3RoKCktMSkgPT0gJyAnKQoJCXsKCSAgICAgICAgICAgcyA9IHMuc3Vic3RyaW5nKDAsIHMubGVuZ3RoKCktMSk7CgkJfQoJCVN5c3RlbS5vdXQucHJpbnQocyk7Cgl9Cn0=