Use split to split a string into a list, for example:
>>> '2 2 4 5 7'.split()
['2', '2', '4', '5', '7']
As you see, elements are string. If you want to have elements as integers, use int and a list comprehension:
>>> [int(elem) for elem in '2 2 4 5 7'.split()]
[2, 2, 4, 5, 7]
So, in your case, you would do something like:
import sys
list_of_lists = []
for line in sys.stdin:
new_list = [int(elem) for elem in line.split()]
list_of_lists.append(new_list)
You will end up having a list of lists:
>>> list_of_lists
[[3], [2], [2, 2, 4, 5, 7]]
If you want to have those lists as variables, simply do:
list1 = list_of_lists[0] # first list of this list of lists
list1 = list_of_lists[1] # second list of this list of lists
list1 = list_of_lists[2] # an so on ...