Algorithm to sort documents physically java
===

I have a scanner that captures account numbers from a couple of documents. I need an algorithm that sorts these documents physically. The scanner has 11 pockets used to be separated. I tried some (Merge sort, Bucket sort) but not how a fixed number of pockets. My solution so far is that I do one pass of all documents, which serve to recognize the entire universe. I also acknowledge that I have to pass several times all documents through the scanner to be sorted physically. Any doubt I can answer those. If possible in java. Thanks

sorry for my english because i am from Chile...