def chuthuong(s):
for i in range(0,len(s)):
if 'a'<=s[i] and s[i]<='z':
return True
return False
def chuhoa(s):
for i in range(0,len(s)):
if 'a'<=s[i] and s[i]<='z':
return True
return False
def so(s):
for i in range(0,len(s)):
if '0'<=s[i] and s[i]<='9':
return True
return False
def kitu(s):
for i in range(0,len(s)):
if s[i]=='$' or s[i]=='#' or s[i]=='@':
return True
return False
matkhau = input()
st=""
for i in range(0,len(matkhau)):
if matkhau[i]!=',':
st=st+matkhau[i]
else:
if (chuhoa(st) and chuthuong(st) and so(st) and kitu(st) and len(st)>=6 and len(st)<=12):
print(st)
st=""
if (st!=""):
if (chuhoa(st) and chuthuong(st) and so(st) and kitu(st) and len(st)>=6 and len(st)<=12):
print(st)
ZGVmIGNodXRodW9uZyhzKToKICAgIGZvciBpIGluIHJhbmdlKDAsbGVuKHMpKToKICAgICAgICBpZiAnYSc8PXNbaV0gYW5kIHNbaV08PSd6JzoKICAgICAgICAgICAgcmV0dXJuIFRydWUKICAgIHJldHVybiBGYWxzZQoKZGVmIGNodWhvYShzKToKICAgIGZvciBpIGluIHJhbmdlKDAsbGVuKHMpKToKICAgICAgICBpZiAnYSc8PXNbaV0gYW5kIHNbaV08PSd6JzoKICAgICAgICAgICAgcmV0dXJuIFRydWUKICAgIHJldHVybiBGYWxzZQoKZGVmIHNvKHMpOgogICAgZm9yIGkgaW4gcmFuZ2UoMCxsZW4ocykpOgogICAgICAgIGlmICcwJzw9c1tpXSBhbmQgc1tpXTw9JzknOgogICAgICAgICAgICByZXR1cm4gVHJ1ZQogICAgcmV0dXJuIEZhbHNlCgpkZWYga2l0dShzKToKICAgIGZvciBpIGluIHJhbmdlKDAsbGVuKHMpKToKICAgICAgICBpZiBzW2ldPT0nJCcgb3Igc1tpXT09JyMnIG9yIHNbaV09PSdAJzoKICAgICAgICAgICAgcmV0dXJuIFRydWUKICAgIHJldHVybiBGYWxzZQoKbWF0a2hhdSA9IGlucHV0KCkKc3Q9IiIKZm9yIGkgaW4gcmFuZ2UoMCxsZW4obWF0a2hhdSkpOgogICAgaWYgbWF0a2hhdVtpXSE9JywnOgogICAgICAgIHN0PXN0K21hdGtoYXVbaV0KICAgIGVsc2U6CiAgICAgICAgaWYgKGNodWhvYShzdCkgYW5kIGNodXRodW9uZyhzdCkgYW5kIHNvKHN0KSBhbmQga2l0dShzdCkgYW5kIGxlbihzdCk+PTYgYW5kIGxlbihzdCk8PTEyKToKICAgICAgICAgICAgcHJpbnQoc3QpCiAgICAgICAgICAgIHN0PSIiCmlmIChzdCE9IiIpOgogICAgaWYgKGNodWhvYShzdCkgYW5kIGNodXRodW9uZyhzdCkgYW5kIHNvKHN0KSBhbmQga2l0dShzdCkgYW5kIGxlbihzdCk+PTYgYW5kIGxlbihzdCk8PTEyKToKICAgICAgICAgICAgcHJpbnQoc3Qp