#include using namespace std; using Int = long long; const char newl = '\n'; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< vector read(size_t n){ vector ts(n); for(size_t i=0;i>ts[i]; return ts; } template struct SegmentTree{ using F = function; int n; F f; T ti; vector dat; SegmentTree(){} SegmentTree(F f,T ti):f(f),ti(ti){} void init(int n_){ n=1; while(n &v){ int n_=v.size(); init(n_); for(int i=0;i>=1) dat[k]=f(dat[(k<<1)|0],dat[(k<<1)|1]); } T query(int a,int b){ if(a>=b) return ti; T vl=ti,vr=ti; for(int l=a+n,r=b+n;l>=1,r>>=1) { if(l&1) vl=f(vl,dat[l++]); if(r&1) vr=f(dat[--r],vr); } return f(vl,vr); } template int find(int st,C &check,T &acc,int k,int l,int r){ if(l+1==r){ acc=f(acc,dat[k]); return check(acc)?k-n:-1; } int m=(l+r)>>1; if(m<=st) return find(st,check,acc,(k<<1)|1,m,r); if(st<=l&&!check(f(acc,dat[k]))){ acc=f(acc,dat[k]); return -1; } int vl=find(st,check,acc,(k<<1)|0,l,m); if(~vl) return vl; return find(st,check,acc,(k<<1)|1,m,r); } template int find(int st,C &check){ T acc=ti; return find(st,check,acc,1,0,n); } }; struct Precision{ Precision(){ cout< seg(f,ti); int n,q; cin>>n>>q; vector vt(n,T(1,0,0,0)); seg.build(vt); const D pi = asin(1) * 2; auto print=[&](T res){ // cout<<":"<>t; if(t==0){ int i,x; cin>>i>>x; i--; vt[i].theta=x*pi/180.0; seg.set_val(i,vt[i]); } if(t==1){ int i,x; cin>>i>>x; i--; D len=hypot(vt[i].x,vt[i].y); vt[i].x*=x/len; vt[i].y*=x/len; seg.set_val(i,vt[i]); } if(t==2){ int i; cin>>i; print(seg.query(0,i)); } } // print(f(vt[0],vt[1])); // print(vt[2]); // cout<