Hi there,
Why did you have to phrase this like a Math problem in an exam?
OK, now that my brain doesn't hurt (as much) haha, the answer is 'Train X will arrive at Town B in 15 minutes'. No? Damn it!
OK, OK, no more joking. Whatsapp will check that your number is active with your carrier. Since you'll be getting a new SIM to use on device Y, device X will no longer be active with that number and Whatsapp will check for that (eventually) and will not allow the device to access your account.
When you activate your new SIM (with the same number) in Device Y and load Whatsapp there, it'll de-activate device X and will transfer your chat history and documents ONLY if they have been backed up to a cloud service or file.
If you plan to change your number on Device Z (or device Y or whatever with a different SIM), however, you must still have access to the original number BEFORE you switch phones. Then you go into your Settings, Account, and select the CHANGE NUMBER option. Follow the instructions there, activate in your new phone, and the old account will be closed and that number will not have access to your account any longer (and if anyone uses that number they'll get a new account).