Every morning Sanggeun goes to the lab and weighs samples. He picks two samples and uses a balance to measure the difference between their weights.
To impress the professor he weighs samples all morning, but sometimes the professor comes into the lab and asks Sanggeun for the weight difference between two particular samples. Depending on the measurements made so far, Sanggeun may or may not be able to answer.
Sanggeun has written down every result in a notebook since his first day, but there are so many entries that he cannot answer the professor's questions quickly. Let us write a program to help him.
The actions Sanggeun performs in the lab are given in order. For each of the professor's questions, determine whether the weight difference between two samples can be deduced.
The input consists of several test cases.
The first line of each test case contains the number of sample types $N$ ($2 \le N \le 100{,}000$) and the number of actions Sanggeun performs $M$ ($1 \le M \le 100{,}000$). Samples are numbered from $1$ to $N$. Each of the next $M$ lines describes one action.
A measurement is given as ! a b w, meaning that sample $b$ is $w$ grams heavier than sample $a$ ($a \ne b$). Here $w$ is a non-negative integer not exceeding $1{,}000{,}000$. All measurements are accurate and mutually consistent.
A question from the professor is given as ? a b, which asks how much heavier $b$ is than $a$.
The last line contains two zeros.
Whenever a question ? a b is given, if the difference between the weights of $a$ and $b$ can be computed from the measurements made so far, output how much heavier $b$ is than $a$. The absolute value of this difference does not exceed $1{,}000{,}000$. If the difference cannot be computed from the measurements, output UNKNOWN.