The valid lines in the file /etc/hosts are A and C. The format of the /etc/hosts file is as follows12:
IP_address canonical_hostname [aliases...]
where IP_address is the IPv4 or IPv6 address of the host, canonical_hostname is the official name of the host, and aliases are optional alternative names for the host. Each field is separated by whitespace (spaces or tabs). The # character indicates the beginning of a comment, and the rest of the line is ignored.
The lines B, D, and E are invalid because they do not follow the format of the /etc/hosts file. Line B has the hostname and aliases before the IP address, which is incorrect. Line D has multiple IP addresses and hostnames separated by commas, which is also incorrect. Line E has two IP addresses for the same host, which is not supported by the /etc/hosts file. If a host has more than one IP address, it should have a separate line for each address3.
References:
1: hosts(5) - Linux manual page - man7.org
2: Format of /etc/hosts on Linux (different from Windows?)
3: hosts File Format for TCP/IP - IBM
Submit