Some words in Spanish are just like that. To determine whether it is feminine or masculine, we depend on the definite articles to help us out. Unfortunately, that is not provided in this case. So you really just have to use your best judgement and use the process of elimination to determine your final answer.
If you have any more questions, let me know!
Hope this helped !! :)
Many rules and many exceptions. https://www.spanishdict.com/guide/masculine-and-feminine-nouns