The problem is that input.split () returns a list of strings, not numbers. Then you compare these lines in the hope of getting a sort of numbers, and this is not the same thing.
This can be seen on the site you provided with step-by-step execution: 
It is enough when parsing the entered string to bring each substring to a number, in this case, apparently, to an int:
a=set([int(x) for x in input().split()]) b=set([int(x) for x in input().split()])
In the end, we get the following code:
a=set([int(x) for x in input().split()]) b=set([int(x) for x in input().split()]) c=(set(a.intersection(b))) c=list(c) c.sort() print(*c)
UPD
Why did the original code work correctly on some test data?
It's simple, in the first two tests the intersection of two lists did not contain a number greater than 9, i.e. the substrings consisted of one element, the comparison of such strings occurs by their numerical representation, be it ASCII or any other encoding. Comparing strings with 2+ characters is a completely different story, they are compared element by element + and the result of this comparison is affected by the size of the string.
What is * s?
In this case, this operation unpacks the list into separate elements, which are eventually substituted into print() as positional arguments.