for(int c,n;;write(n,c>0?none:endl))c=(10c+(n=(int)getc(stdin)))%7;