}
for(p = l->next; p; p = p->next)
{
top = p->top;
ans[cnt++] = top;
}
if(cnt == 1)
printf("%d pile remaining:", cnt);
else
printf("%d piles remaining:", cnt);
for(i = cnt-1; i>-1; i--)
printf(" %d", ans[i]);
printf("\n");
}
return 0;
}