How to pass a list of files to ImageMagick's montgae?

view story

http://superuser.com – I have a large number of tiles, with the following naming convention: A-x-y.jpg where 0<=x<=16 & 0<=y<=14 Now I know that we can use the Montage tool in ImageMagick, to merge them into one whole image. Ideally I could have used the following command line: montage *.jpg -geometry +0+0 -tile 17x15 all.jpg but my files are such that A-0-0.jpg is directly above A-0-1.jpg, which is above A-0-2.jpg and A-1-0.jpg is to the right of A-0-0.jpg. So when I use the above command the order is wrong. I have a text file with the correct order. Can I use the text file as an input to (HowTos)