You are going to need two (non-nested) loops.