/*Sursa mea are cea mai mare Va10are :)) */
/* http://oananightshade.files.wordpress.com/2010/08/cocalar-012.jpg */
#include <fstream>
#include <vector>
#include <bitset>
using namespace std;
const char infile[] = "arbore.in";
const char outfile[] = "arbore.out";
//ifstream fin(infile);
ofstream fout(outfile);
const int MAXN = 100005;
const int oo = 0x3f3f3f3f;
typedef vector<int> Graph[MAXN];
typedef vector<int> :: iterator It;
const inline int min(const int &a, const int &b) { if( a > b ) return b; return a; }
const inline int max(const int &a, const int &b) { if( a < b ) return b; return a; }
const inline void Get_min(int &a, const int b) { if( a > b ) a = b; }
const inline void Get_max(int &a, const int b) { if( a < b ) a = b; }
int N, M, First[MAXN], Last[MAXN], Liniarize[MAXN << 1], Ans, K;
Graph G;
pair <int, int> Arb[MAXN << 3];
class Scanner {
public:
Scanner(string file, int buffer_size = 32768):
buffer_size_(buffer_size) {
file_ = fopen(file.c_str(), "r");
buffer_ = new char[buffer_size];
pointer_ = buffer_ + buffer_size_;
}
Scanner& operator>>(int &object) {
object = 0;
while (next() < '0' or next() > '9')
advance();
while (next() >= '0' and next() <= '9') {
object = object * 10 + next() - '0';
advance();
}
return *this;
}
private:
char next() {
if (pointer_ == buffer_ + buffer_size_) {
pointer_ = buffer_;
fread(buffer_, 1, buffer_size_, file_);
}
return *pointer_;
}
void advance() {
++pointer_;
}
FILE *file_;
int buffer_size_;
char *buffer_, *pointer_;
};
Scanner fin(infile);
void DFs(const int &Node, const int &Father) {
Liniarize[ ++ K] = Node;
First[Node] = K;
for(It it = G[Node].begin(), fin = G[Node].end(); it != fin ; ++ it) {
if(Father == *it)
continue;
DFs(*it, Node);
}
Liniarize[ ++ K ] = Node;
Last[Node] = K;
}
void Update(const int &Node, const int &st, const int &dr, const int &ind, const int &value) {
if(First[ind] <= st && dr <= Last[ind]) {
Arb[Node].first += value;
} else {
int mid = ((st + dr) >> 1);
if(First[ind] <= mid)
Update(2*Node, st, mid, ind, value);
if(mid < Last[ind])
Update(2*Node + 1, mid + 1, dr, ind, value);
}
Arb[Node].second = Arb[Node].first + max(Arb[2*Node].second, Arb[2*Node + 1].second);
}
void Query(const int &Node, const int &st, const int &dr, const int &value) {
if(Ans != -1)
return;
if(Arb[Node].first == value) {
Ans = Liniarize[st];
return;
}
if(st < dr && Arb[Node].first < value && Arb[Node].second >= value) {
int mid = ((st + dr) >> 1);
Query(2*Node, st, mid, value - Arb[Node].first);
Query(2*Node + 1, mid + 1, dr, value - Arb[Node].first);
}
}
int main() {
fin >> N >> M;
for(int i = 1 ; i != N ; ++ i) {
int x, y;
fin >> x >> y;
G[x].push_back(y);
G[y].push_back(x);
}
DFs(1, 0);
for(int i = 1 ; i <= M ; ++ i) {
int q, x, y;
fin >> q;
if(q == 1) {
fin >> x >> y;
Update(1, 1, K, x, y);
}
else {
Ans = -1;
fin >> x;
Query(1, 1, K, x);
fout << Ans << '\n';
}
}
return 0;
}