#include using namespace std; int main(){ int N, K; cin >> N >> K; cout << N * (N - 1) / 2 * 3 + 1 << endl; for (int i = 0; i < N; i++){ for (int j = N - 2; j >= i; j--){ int a = j, b = j + 1; cout << "XOR " << N << ' ' << a << ' ' << b << endl; cout << "AND " << b << ' ' << a << ' ' << b << endl; cout << "XOR " << a << ' ' << b << ' ' << N << endl; } } cout << "AND " << N << ' ' << K - 1 << ' ' << K - 1 << endl; }