/*
TASK:money
LANG:C++
*/
#include <stdio.h>
#include <string.h>
int sum_array(int a[80],int end) {
    int k,sum=0;
    
    for (k=0;k<end;k++) {sum+=a[k];} 
    return sum;
}

int main(){
    char s[80];
    char s_last;
    int chisla[80],max_4isl[80];
    int i,j=0,m,max=0,pr,max_j;
    
    gets(s);
    s_last=s[strlen(s)-1];
    
    if (s_last!='#') {
    for (i=0;i<strlen(s);i++) {
        if ((s[i]>='0') && (s[i]<='9')) {
                        chisla[j]=s[i]-'0';
                        if ((s[i+1]>'9') || (s[i+1]<'0')) {
                                         pr=sum_array(chisla,j);
                                         if ((pr>max) && (pr%3==0)) {
                                                      for (m=0;m<j;m++) {
                                                          max_4isl[m]=chisla[m];
                                                          chisla[m]=0;
                                                          max_j=j;
                                                      }
                                                      } 
                                         }
                        else j++;
                        }
}   
    
    while (s_last!='#') {
          gets(s);
          s_last=s[strlen(s)-1];
              for (i=0;i<strlen(s);i++) {
        if ((s[i]>='0') && (s[i]<='9')) {
                        chisla[j]=s[i]-'0';
                        if ((s[i+1]>'9') || (s[i+1]<'0')) {
                                         pr=sum_array(chisla,j);
                                         if ((pr>max) && (pr%3==0)) {
                                                      for (m=0;m<j;m++) {
                                                          max_4isl[m]=chisla[m];
                                                          chisla[m]=0;
                                                          max_j=j;
                                                      }
                                                      } 
                                         }
                        else j++;
                        }
           }
    if (max==0) {printf("No");}
    else {for (i=0;i<max_j;i++) {printf("%c",max_4isl[i]);}
    

} } } }
