X = [-1, -2, -3, -4, -5, 1, 2, 3]
R = []

for i in X:
    if i < 0:
        R.append(i)
        X.pop(X.index(i))
print(R)
print(X)
