*"Sort the unsorted elements and square the elements in it"*), the output you are getting is correct.

If you really wish to obtain a

*sorted list of squares*, then you have first to generate a list of squares and then sort it.

Try

Python

lin = list(map(int,input().split())) # original list lsq = ([x*x for x in lin]) # list of squares lsq = sorted(lsq) # sorted list of squares for sq in lsq: print(sq, sep=" ")