The gender and noun class of a compound noun is the same as that of the head noun in the compound (i.e. the noun which gives the compound its basic meaning, for example a "tine chnámh" is a kind of "tine"), this is usually the first noun (in which case the two nouns are written as separate words) but there are also cases where the head noun is the second noun, e.g. "téacsleabhar" (the two nouns are then written together as one word). So "tine chnámh" is a 4th declension feminine noun like "tine" (plural: "tinte cnámh"); and "téacsleabhar" is a 1st declension masculine noun like "leabhar" (plural: "téacsleabhair").