CF156B.Suspects

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

As Sherlock Holmes was investigating a crime, he identified nn suspects. He knows for sure that exactly one of them committed the crime. To find out which one did it, the detective lines up the suspects and numbered them from 11 to nn . After that, he asked each one: "Which one committed the crime?". Suspect number ii answered either "The crime was committed by suspect number aia_{i} ", or "Suspect number aia_{i} didn't commit the crime". Also, the suspect could say so about himself ( ai=ia_{i}=i ).

Sherlock Holmes understood for sure that exactly mm answers were the truth and all other answers were a lie. Now help him understand this: which suspect lied and which one told the truth?

输入格式

The first line contains two integers nn and mm ( 1<=n<=105,0<=m<=n1<=n<=10^{5},0<=m<=n ) — the total number of suspects and the number of suspects who told the truth. Next nn lines contain the suspects' answers. The ii -th line contains either "+ aia_{i} " (without the quotes), if the suspect number ii says that the crime was committed by suspect number aia_{i} , or "- aia_{i} " (without the quotes), if the suspect number ii says that the suspect number aia_{i} didn't commit the crime ( aia_{i} is an integer, 1<=ai<=n1<=a_{i}<=n ).

It is guaranteed that at least one suspect exists, such that if he committed the crime, then exactly mm people told the truth.

输出格式

Print nn lines. Line number ii should contain "Truth" if suspect number ii has told the truth for sure. Print "Lie" if the suspect number ii lied for sure and print "Not defined" if he could lie and could tell the truth, too, depending on who committed the crime.

输入输出样例

  • 输入#1

    1 1
    +1
    

    输出#1

    Truth
    
  • 输入#2

    3 2
    -1
    -2
    -3
    

    输出#2

    Not defined
    Not defined
    Not defined
    
  • 输入#3

    4 1
    +2
    -3
    +4
    -1
    

    输出#3

    Lie
    Not defined
    Lie
    Not defined
    

说明/提示

The first sample has the single person and he confesses to the crime, and Sherlock Holmes knows that one person is telling the truth. That means that this person is telling the truth.

In the second sample there are three suspects and each one denies his guilt. Sherlock Holmes knows that only two of them are telling the truth. Any one of them can be the criminal, so we don't know for any of them, whether this person is telling the truth or not.

In the third sample the second and the fourth suspect defend the first and the third one. But only one is telling the truth, thus, the first or the third one is the criminal. Both of them can be criminals, so the second and the fourth one can either be lying or telling the truth. The first and the third one are lying for sure as they are blaming the second and the fourth one.

首页