its time year Felicity corner people celebrate himalayan region the Himalayan region n gym the ith gym gi Pokemon there m distinct Pokemon type Himalayan region number 1 m there special evolution camp set f claim evolve Pokemon the type Pokemon change evolve subject constraint Pokemon type evolving type evolve also Pokemon different type evolve different type evolve it possible Pokemon type evolve Formally evolution plan permutation f 12 m fxy mean Pokemon type x evolve Pokemon type yThe gym leader intrigue special evolution camp plan evolve pokemon the protocol mountain state gym type Pokemon number Pokemon type evolve Pokemon equal number Pokemon type evolve pokemon accord evolution plan they want find distinct evolution plan exist satisfy protocolTwo evolution plan f1 f2 distinct Pokemon type evolve different Pokemon type plan e exist f1if2iyour task find distinct evolution plan possible Pokemon gym evolve number Pokemon type gym remain as answer large output modulo 1097