#include <stdio.h>
int main()
{
int i,o=0,top=0,p=0,q;
char d[222222],a[1000],b[244][50]= {"Paint.Picture","Word.Document.8","word.Document.12","htmfile","htmfile","Hwp.Document.96","Hwp.Document.hwpx.96","Hwp.Document.hwt.96","jpegfile","jpegfile","jpegfile","PowerPoint.Show.8","PowerPoint.Show.12","powerpointxmlfile"};
char c[22][20]= {".did",".doc",".docx",".htm",".html",".hwp",".hwpx",".hwt",".jpe",".jpeg",".jpg",".ppt",".pptx",".pptxml"};
scanf("%s",a);
for(i=0; i<=strlen(a)-1; i++)
{
if(a[i]=='.')
{
o=1;
}
if(o==1)
{
d[top]=a[i];
top++;
}
}
o=0;
//printf("%d ",strlen(c[13]));
for(i=13; i>=0; i--)
{
for(o=0; o<=strlen(d); o++)
{
if(d[o]==c[i][o])
{
p++;
}
{
if(p==strlen(c[i]))
{
for(q=0; q<=strlen(b[i]); q++)
{
printf("%c",b[i][q]);
}
return 0;
}
}
}
p=0;
}
}
a