Guilds

No attempts yetTime limit1sMemory limit128 MB

Problem

King Byteasar faces a serious matter. Two competing trade organisations, the Tailors' Guild and the Sewers' Guild, have at the same time asked for permission to open offices in the towns of his kingdom.

Byteotia has nn towns, some of them joined by bidirectional roads. Each town may host an office of the Tailors' Guild, an office of the Sewers' Guild, or no office at all. To keep both guilds satisfied, the placement must obey the following rule for each guild independently: every town must either

  • host an office of that guild, or
  • be directly connected by a road to a town that hosts an office of that guild.

The king, however, suspects foul play. If a single town were to host the offices of both guilds at once, it could lead to a clothing cartel, so he forbids any town from hosting both offices.

Determine whether the offices can be placed according to these rules.

Input

The first line contains two integers nn and mm (1n200,0001 \le n \le 200{,}000, 0m500,0000 \le m \le 500{,}000): the number of towns and the number of roads in Byteotia. The towns are numbered from 11 to nn.

Each of the next mm lines describes one road with two integers aia_i and bib_i (1ai,bin1 \le a_i, b_i \le n, aibia_i \ne b_i), meaning that the ii-th road connects towns aia_i and bib_i. Every pair of towns is joined by at most one road. Roads meet only at towns (they may pass through tunnels or overpasses) and never cross elsewhere.

Output

Print a single line: TAK if the offices can be placed according to the rules, or NIE otherwise. (TAK and NIE mean "yes" and "no" in Polish.)

Hint

In the illustration, the towns where a Tailors' Guild office should open are marked with circles, and the towns where a Sewers' Guild office should open are marked with rhombi.