[Question]
  [
The [Māori language](https://en.wikipedia.org/wiki/M%C4%81ori_language) has quite simple pronouns. It uses a single word for he/she/they/etc (`ia`), and the words for "you" and "me" are `koe` and `au` respectively.
There are also words for groups of exactly two people:
* `tāua` - You and me (we, `au` and `koe`)
* `māua` - Me and them (we, `au` and `ia`)
* `rāua` - Them (third person plural - two of them, `ia` and `ia`)
* `kōrua` - You two (`koe` and `koe`)
And for three or more people:
* `tātou` - All of you and me (we, `au` and multiple `koe`)
* `mātou` - Me and all of them (we, `au` and multiple `ia`)
* `rātou` - All of them (third person plural, multiple `ia`)
* `koutou` - All of you (multiple `koe`)
Your challenge is to take a list of `ia`, `koe` and `au` and return the correct pronoun. You may assume that there is at most one `au` and that `ia` and `koe` will never both be in the input.
You may take input in any reasonable format - An array of `ia`, `koe` and `au` or three distinct values (within reason) representing those, an array of the counts of each word, a dictionary containing the counts of each word, space-separated words etc.
When there is only one word, you should output that.
Note that some of the outputs contain Unicode (`ā` and `ō`). You may output these as they are or as double letters - `aa` and `oo`.
For example, `ia ia` becomes `rāua` as it is two `ia`. `au ia ia ia ia` becomes `mātou` as it is one `au` and more than two `ia`. `koe koe` becomes `kōrua`.
# Testcases
```
ia -> ia
koe -> koe
koe au -> tāua
ia ia -> rāua
koe koe koe koe koe -> koutou
ia ia au ia -> mātou
ia ia ia ia ia ia ia -> rātou
```
  
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 94 bytes
```
a=>(g=r=>!!a.match(r))` `?'krtm'[h=g`u`*2+g`i`]+(g` .* `?h?'aatou':'outou':h?'aaua':'oorua'):a
```
[Try it online!](https://tio.run/##dYzLCoMwEEX3/Yq4SqLURZdC9ENKYQarMfUxEpP@fpraVSXCDBfOnTkvfOPWWrO660LPLvQqoKqFVlbVWYbljK4dhJUSGDR8tG7m90Fp8JDfCg0GHoXQwMo81kPDER15XnHye@7E4xeQjSkrDC0tG01dOZEWveAmUnk5wJG6NGXoE4VBdqZhhz37juK049f@TzwLHw "JavaScript (Node.js) – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 121 bytes
```
x=>x[1]?'koutou0tātou0rātou0mātou0kōrua0tāua0rāua0māua'.split(0)[g=y=>x.includes(y+''),g`au`+g`ia`*2+4*!x[2]]:x[0]
```
[Try it online!](https://tio.run/##XVBLDsIgEN33FHVVsIrVuNJUD9I0gVQkWFoaWgwuPYC30nPVAVyZMPOGeW8@cGN3NjZGDtO61xc@X8vZlSdXbetz1mo7aVtM76cHE6GL0H5exjLPgTfBd95nZByUnFCBK1E@oBORfaPshY/okWcZXgnKLM0FlYwud/l@uXDVrq4Prirq@ZhAOl2fUsmSVnMfAYSQWX8L4xLQRFmYG@h/C5V@@58YymNJXP@X/TuxI9CUGD4o1nC0ITk6l8DgjVjBxzS6H7XiRGmBrsjFx9KUYoznLw "JavaScript (Node.js) – Try It Online")
Tabling n>2, "ia" exist, and "au" exist
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 53 bytes
```
≔№θ η¿¬ηθ«≔⁺∧№θia²№θauζ¿ζ⁺§rtmζaa¿⊖ηkou¦koor¿⊖ηtou¦ua
```
[Try it online!](https://tio.run/##dY67DsIwDEXn9iusTIlUFlamChYW1F@IWkOjtonIA6Eivj3EhUAXBi/X9xy77aVtjRxjrJ1TF833JmjPrxUwYKKCXuxKdQZ@Mp73QkBjFa1TiqNDeJTFh2vG4Hitu5VASTJs0/wyGZhIwZwEBXnnrHzz/qg7vHNm/cSoRUSyUHu5R8gBW4sTao/d6iU2mKTOvW9mLMun/nB@4WCNBUnQM0YZYDCYp4yb2/gC "Charcoal – Try It Online") Link is to verbose version of code. Output uses double vowels. Explanation:
```
≔№θ η
```
Count the number of spaces in the input. (Note that due to Charcoal's input format autodetection, you need a trailing newline in the input for this to work.)
```
¿¬ηθ«
```
If there are no spaces, then just print the input.
```
≔⁺∧№θia²№θauζ
```
Count `2` if `ia` is present, plus `1` if a (assumed single) `au` is present.
```
¿ζ⁺§rtmζaa
```
If either are present then output `taa`, `maa` or `raa` as appropriate, ...
```
¿⊖ηkou¦koor
```
... otherwise output `kou` or `koor` depending on the number of words.
```
¿⊖ηtou¦ua
```
Output `tou` or `ua` depending on the number of words.
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 124 bytes
```
lambda n:[n,'rmkt'[2*('k'in n)+('u'in n)]+['ou','oa'['a'in n]*2][[*n].count('k')<3]+['ua','tou'][len(n.split())>2]][' 'in n]
```
[Try it online!](https://tio.run/##XVDBbsMgDL3nK6xeHNKoh/QyVWt/hKLKaxIVJTGIgLTt5zMI6apNwtjwnt8z2C//MHx8s27pz9dlpOmjJeCT5BrdNHiUTVXigJqBxb7EkCu1l2gC1mgIJdJ6qapGSVmxOtxNYJ@6xPsxMQNFpo98JceOSz7MdtS@FOLSKCURcvui2d5m7@AMiKipGEyXAigUmiBfwL/ISKQkPNd/V5Ta7PDKKIqi@7Td3XftzQRvg09ukZjkPFEgcOs@RNQEmIhScmt6CkWR3jiI49bwVIsn@Na23N7wAjYbcSrAOh2/pU8cUUfXGfyjg22MpLjDOqviDojbFf412Hh6xpe4WH4A "Python 3.8 (pre-release) – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~110~~ 79 bytes
```
^(?=(.*au)?)(?=(?<1>.*ia)?){2}\w+ \w+
$#1aaua
T`d`ktmr
ua .*
tou
kaa
kou
uu
oru
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wP07D3lZDTyuxVNNeE8S0tzG009PKTARyq41qY8q1FYCYS0XZMDGxNJErJCElIbskt4irNFFBT4urJL@UKzsxkSsbSJeWcuUXlf7/nwnipoKwQmIpV2aiAkRAAQ1DZIBKQPIQNioCAA "Retina 0.8.2 – Try It Online") Link includes test cases. Output uses double vowels as those accented characters aren't in Retina's default code page. Explanation:
```
^(?=(.*au)?)(?=(?<1>.*ia)?){2}\w+ \w+
```
See whether the input contains `au`, matching as `$#1`, plus add two further matches to `$#1` if the input contains `ia`. Also delete two words from the input (this fails if the input only contains one word).
```
$#1aaua
```
Replace the first two words with the count of matches suffixed with `aaua`.
```
T`d`ktmr
```
Replace the count with the appropriate letter.
```
ua .*
tou
```
If there were more than two words then change the `ua` to `tou`.
```
kaa
kou
```
`kaatou` should be `koutou`.
```
uu
oru
```
But `kouua` should be `koorua`.
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-apl`, 71 bytes
```
k=$F[2]?:koutou: :kōrua;$_=!/a/?k:(/k/??t:/u/??m:?r)+?ā+k[3,3]if$F[1]
```
[Try it online!](https://tio.run/##KypNqvz/P9tWxS3aKNbeKju/tCS/1ErBKvtob1FporVKvK2ifqK@fbaVhn62vr19iZV@KZDKtbIv0tS2P9KonR1trGMcm5kG1G8Y@/9/ZiJXdn4qV2IpiFIAUomlChAxBZB4ZiISTwGqCg1DFClANELYqOhffkFJZn5e8X/dxIIcAA "Ruby – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~57 52 51 49~~ 47 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
“mtr”;€⁾aa;“kou“koor”⁽ñỌ,ḥ;Lị““ua“tou”Ɗ
Ṣḣ3ÇḢḊ?
```
A monadic Link accepting a list of lists of characters that yields a list of characters, the pronoun.
**[Try it online!](https://tio.run/##y0rNyan8//9Rw5zckqJHDXOtHzWtedS4LzHRGiiUnV8KJvNBMo8a9x7e@HB3j87DHUutfR7u7gZKAVFpIpAoASmce6yL6@HORQ93LDY@3P5wB5DRZf////9o9cxEdR0FFDKxFMqOBQA "Jelly – Try It Online")** Or see the [test-suite](https://tio.run/##y0rNyan8//9Rw5zckqJHDXOtHzWtedS4LzHRGiiUnV8KJvNBMo8a9x7e@HB3j87DHUutfR7u7gZKAVFpIpAoASmce6yL6@HORQ93LDY@3P5wB5DRZf//4e4tD3dsAhp6uB1IRP7/n5nIlZ2fCsIKiaVcmYkKEAEFNAyRASoByUPYqAgA "Jelly – Try It Online").
### How?
```
“mtr”;€⁾aa;“kou“koor”... - Link 1: list of lists of characters, X
“mtr”                    - "mtr"
       ⁾aa               - "aa"
     ;€                  - concatenate each -> ["maa", "taa", "raa"]
           “kou“koor”    - ["kou", "koor"]
          ;              - concatenate
                         -> domain = ["maa", "taa", "raa", "kou", "koor"]
...⁽ñỌ,ḥ;Lị““ua“tou”Ɗ - Link 1 (continued)
   ⁽ñỌ                - 7932
      ,               - pair
       ḥ              - hash X with a salt of 7932 and our domain (from above)
                    Ɗ - last three links as a monad - f(X):
         L            -   length (2 or 3)
           ““ua“tou”  -   ["", "ua", "tou"]
          ị           -   index into
        ;             - concatenate
Ṣḣ3ÇḢḊ? - Main Link: list of lists of characters, I
Ṣ       - sort I
 ḣ3     - keep up to the first three
      ? - if...
     Ḋ  - ...condition: dequeue (i.e. is length > 1 ?)
   Ç    - ...then: call Link 1
    Ḣ   - ...else: head of I
```
]