here is the relevant code. basically, it tries to read it as a python list (if it's not a list, it fails); when that fails it splits by newline if it's multiple lines, otherwise by space. as a side effect, sometimes it acts weird when you give it one line, if you add a newline at the end of input that'll make it split by line instead