Y is negative and X is negative
At the time When the third ball should carry a positive charge is brought near the first two, it gets polarized X contains –ve charge and Y contain a +ve charge. After this Y is connected to the ground and the electron move up from the ground after that ground wire should be disconnected due to this electron has canceled the net +ve charge on Y.
learn more about the charge here: https://brainly.com/question/18200549