In this paper, we derive the capacity of the deterministic relay networks with relay messages. We consider a network which consists of five nodes, four of which can only communicate via the fifth one. However, the fifth node is not merely a relay as it may exchange private messages with the other network nodes. First, we develop an upper bound on the capacity region based on the notion of a single sided genie. In the course of the achievability proof, we also derive the deterministic capacity of a 4-user relay network (without private messages at the relay). The capacity achieving schemes use a combination of two network coding techniques: the Simple Ordering Scheme (SOS) and Detour Schemes (DS). In the SOS, we order the transmitted bits at each user such that the bi-directional messages will be received at the same channel level at the relay, while the basic idea behind the DS is that some parts of the message follow an indirect path to their respective destinations. This paper, therefore, serves to show that user cooperation and network coding can enhance throughput, even when the users are not directly connected to each other.