Boils down to "How do I know which gender is this word?" the answer to which is either "Memorize all the stuff" or "Get an intuitive feeling by using many times"...
I dont have a cyrillic keyboard on my phone so i get all of these wrong...
You just need to know the equivalent latin letter and type that. Once I discovered that I finally started getting things right.
You can either add a Ukrainian keyboard (why not?..) or transliterate to Latin alphabet like @yomaster19 said. Unfortunately we have no idea what transliteration is correct because this is implemented by the Duolingo itself, not the UkrDuo team. A lot of transliteration gives a "You have a typo" error for no reason (for example, "Tak, dim tam" for "Так, дім там" says there's a typo in every word which is incomprehensible).
My question is that even words like "photo" and "telephone" which both seem to be gender neutral end up being either neutral or male.
Фотография ends in Я and is therefore feminine. Телефон, similarly, is masculine because it ends in a consonant.
Or... does it end with a consonant because we perceive it as masculine? :D
(this is not serious, just contemplating and joking around)
E.g. the word banana is feminine in many languages and ends with "a" (e.g. Italian una banana) or "e" (e.g. German eine Banane). But in Russian it's банан. It's not masculine because it ends with no vowel, we made it end with no vowel because we think it's masculine! :D