Assuming that you have a file named file
that contains lines with mutually different whitespace-separated numbers, and you have a set of 6 numbers - e.g. 38, 39, 40, 41, 42, 43 - that you want to search for in combinations of three, such that lines that consecutively contain three of these numbers in random order are listed as a result of the search, you could use:
grep -P '((^|\s+)(38|39|40|41|42|43)(?=($|\s))){3}' file
which uses grep with a Perl regular expression (PCRE).