just wait until maximum output appears in list, in this case 15 is the maximum output
~o(a*b) to ~O(a^b) I think