How to find the Utility Possibility Frontier when there are Perfect Substitutes? I am trying to derive the Utility Possibility Frontier (UPF) when both utility functions display perfect substitutes (in an Edgeworth economy with to consumers and two goods). 
The specific problem:

$u_A = 2x_{1A}+x_{2A}$

$u_B = x_{1B}+2x_{2B}$

The total endowments being five of each good. Thus:

$x_{1A}+x_{1B}=5$

$x_{2A}+x_{2B}=5$

We are given the hint that "the Utility Possibility Set can be described as the set of
$(u_A, u_B)$ in the non-negative orthant of $R^2$ satisfying: $u_A ≥ 0, u_B ≥ 0$".

I keep trying different approaches, but always end up with imposible conditions. When following the suggestions from this another post (How to derive utility possibility frontier?), I keep getting weird first order conditions such as "1=0". 

Once the UPF is found, we are asked to maximize social welfare through the following Social Welfare Function (SWF):

$W(u_A,u_B) = 3u_A + u_b$

Thank you in advance.
In addition to the solution worked out in the comments, there's also a faster way to find the welfare maximizing distribution:

Note that social welfare can also be written in terms of $x_{1A}$ and $x_{2A}$ as $W(x_{1A},x_{2A})=15+5x_{1A}+x_{2A}$, which is maximized in the Edgeworth box at $(x_{1A},x_{2A})=(5,5)$. As long as utilities are increasing in the quantities of both goods, this point is always on the contract curve and is therefore the maximizer of social welfare independently of the specific forms of the individuals' preferences.