# CF786B/CF787D

#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#define ll long long
#define rt1 (rt<<1)
#define rt2 ((rt<<1)|1)
using namespace std;
struct Edge
{
int nxt;
int to;
ll val;
}edge[5000005];
struct node
{
int p;
ll v;
node (){}
node (int x,ll y):p(x),v(y){}
friend bool operator < (node a,node b)
{
return a.v>b.v;
}
};
int pos1[100005];
int pos2[100005];
bool vis[800005];
ll dis[800005];
int cnt=1;
int n,q,s;
{
edge[cnt].to=r;
edge[cnt].val=w;
}
void buildtree1(int rt,int l,int r)
{
if(l==r){pos1[l]=rt;return;}
int mid=(l+r)>>1;
buildtree1(rt1,l,mid),buildtree1(rt2,mid+1,r);
}
void buildtree2(int rt,int l,int r)
{
if(l==r){pos2[l]=rt+4*n;return;}
int mid=(l+r)>>1;
buildtree2(rt1,l,mid),buildtree2(rt2,mid+1,r);
}
template <typename T>inline void read(T &x)
{
T f=1,c=0;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){c=c*10+ch-'0';ch=getchar();}
x=f*c;
}
void query_add1(int rt,int l,int r,int lq,int rq,int v,ll w)//区间->点
{
int mid=(l+r)>>1;
}
void query_add2(int rt,int l,int r,int lq,int rq,int v,ll w)//点->区间
{
int mid=(l+r)>>1;
}
void diji()
{
memset(dis,0x3f,sizeof(dis));
dis[pos1[s]]=dis[pos2[s]]=0;
priority_queue <node> Q;
Q.push(node(pos1[s],0));
while(!Q.empty())
{
node u=Q.top();
Q.pop();
if(vis[u.p])continue;
vis[u.p]=1;
{
int to=edge[i].to;
if(dis[to]>dis[u.p]+edge[i].val&&!vis[to])dis[to]=dis[u.p]+edge[i].val,Q.push(node(to,dis[to]));
}
}
for(int i=1;i<=n;i++)
{
if(dis[pos2[i]]==0x3f3f3f3f3f3f3f3fll)printf("-1 ");
else printf("%lld ",dis[pos2[i]]);
}
printf("\n");
}
int main()
{
buildtree1(1,1,n),buildtree2(1,1,n);
while(q--)
{
int typ;
ll w;
if(typ==1)
{
int st,ed;
}else if(typ==2)
{
int lq,rq,st;
}else
{
int lq,rq,ed;
}