Keep a stack of 10 coins aside and rest 40 in stack 2 , and then reverse each coin in first group and keep the other group as same. And we get our solution.
Why this works?
10 coins= tails
suppose x tail coins go in group one then tail coins in group two is 10-x. when we reverse the first group, no. of tails become 10-x.