I recently wrote an email in which I wanted to thank to people and wrote
Спасибо болшгое, оба вас.
This was described as "scatalogical" by one of the recipients who suggested instead
Вам обоим, большое спасибо.
I am particularly puzzled by "обоим". Based on the use of "Вам", it's apparent that the suggestion uses the dative case, but I've never seen обо declined as обоим. Is обоим correct in the sense that a school teacher would have their students use it?