#include #include #include using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int N,K; int anscnt = 0; string ans; vector bitvec; void push_upd(int i,int x){ anscnt++; ans += "UPD " + to_string(i) + " " + to_string(x) + "\n"; } void push_and(int i,int x,int y){ anscnt++; ans += "AND " + to_string(i) + " " + to_string(x) + " " + to_string(y) + "\n"; } void push_xor(int i,int x,int y){ anscnt++; ans += "XOR " + to_string(i) + " " + to_string(x) + " " + to_string(y) + "\n"; } void add1(int l1,int r1,int b){ for(int i=l1; i>= 1; if(k & 1) push_and(p,i,p); else{ push_upd(i-1,1); push_xor(p,i-1,p); push_xor(i,i-1,i); push_and(p,i,p); push_xor(p,i-1,p); } } } void solve(int n,int k){ anscnt = 0; ans = ""; for(int i=1; i> N >> K; solve(N,K); if(anscnt > 912) exit(1); cout << anscnt << "\n" << ans; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_inst;