In English, when using a relative pronoun in connection with a preposition, you can either put them together, or split them up and put the relative pronoun at the end of the sentence. In this context be aware of using whom instead of who:
for example:
To whom did you give the magazine. or
Who did you give the magazine to. (dangling prepostion)
This also goes for phrasal verbs:
Please, turn on the light.
Please, turn the light on. (dangling prepostion)