#include #include #include #include #include using namespace std; int n,m; //typedef map > M; struct aaa { int x, y; aaa() {} aaa(int ax, int ay): x(ax), y(ay) {} bool operator< (const aaa & rhs) const { return x > rhs.x; } }; priority_queue Q; int q[202020]; int qu[202020]; int main() { while(scanf("%d %d", &n, &m), n!=0 && m!=0) { // M inq; memset(q, 0, sizeof(int) * (m+10)); int maxqu=0; bool ok=true; for(int i=0; i()); // printf("lb:%d;", lb - q); if (lb == q + m) { ok = false; scanf("\n"); break; } *lb = a; /* for(j=0; j())); inq[a].push_back(lb - q);*/ qu[maxqu++]=lb - q; /* break; } } if(j==m) { ok=false; break; }*/ } if(!ok) { puts("Transportation failed"); } else { printf("%d", qu[0]+1); for(int i=1; i &t=i->second; for(vector::iterator j=t.begin(); j!=t.end(); ++j) { printf("%s%d", first?"":" ", *j+1); first=false; } }*/ puts(""); } } return 0; }