#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 10010, M = 1e5 + 10;
int h[N], e[M * 2], ne[M * 2], idx;
int cnt[N];
bool st[N];
int n, m;
void add(int a, int b)
{
e[idx] = b, ne[idx] = h[a], h[a] = idx++;
}
int main()
{
memset(h, -1, sizeof h);
cin >> n >> m;
for (int i = 1; i <= m; i++)
{
int op;
cin >> op;
if (op == 1)
{
int a, b;
cin >> a >> b;
if (a == b)
continue;
add(a, b), add(b, a);
}
else
{
memset(st, 0, sizeof st);
int p, t;
cin >> p >> t;
cnt[p] += t;
st[p] = true;
for (int i = h[p]; ~i; i = ne[i])
{
int j = e[i];
if (!st[j])
cnt[j] += t;
}
}
}
for (int i = 1; i <= n; i++)
cout << cnt[i] << " ";
return 0;
}