/*
TASK:money
LANG:C++
*/
#include<iostream>
#include<string>

using namespace std;
int main()
{
    int br=0,maxbr=0,sum=0,i,f=0,j,k1,k2,k;
    string a;
    for( ; ; ){
   cin>>a;
   for(i=0;i<80;i++){
        if(a[i]!='#'){
            if(isdigit(a[i])==1){
                for(j=i;isdigit(a[j])==1;j++){
                    sum=sum+a[j]-'0';
                br++;
            }
            if(br>maxbr && sum%3==0){k1=i;k2=j;}
            br=0;
            sum=0;
        }
    }
    else f=1;
}
if(f=1)break;
}
if(maxbr>0)for(i=k1;i<k2;i++){
    cout<<a[i];
}
else 
    cout<<"No";
cout<<"\n";     
    system("PAUSE");
        return 0;
    }
            
        
