#include #include #include using namespace std; unsigned long long n; struct F{ long long unsigned p; queue f; }; // push_back; // pop_front int main(){ unsigned long long i,j,k,x,y,ti,tm; L1: scanf("%llu",&n); if(n==0){ return 0; } { struct F f[10]; for(i=0;i f[i].f.front() ){ tm=f[i].f.front(); ti = i; } } i = ti; if( tm > y )break; else tm = f[i].f.front(); f[i].f.pop(); for(i=0;i= x ){ if(j)printf(",%llu",tm); else{ printf("%llu",tm); j = 1; } } } if( j == 0 ) printf("none"); printf("\n"); } goto L1; }