Go: package main

import (
	"fmt"
)

func main() {
	for i := 1; i <= 9; i++ {
		for j := 1; j <= 9; j++ {
			fmt.Printf("%dx%d=%d\n", i, j, i*j)
		}
	}
}

C++: #include <iostream>
using namespace std;

int main(){
	for(int i=1; i<=9; ++i){
		for(int j=1; j<=9; ++j){
			cout << i << "x" << j << "=" << i*j << endl;
		}
	}

	return 0;
}

C++: #include<stdio.h>

int main()
{
	long long i, j;
	for(i = 1; i <= 9; i++)
	{
		for(j = 1; j <= 9; j++)
		{
			printf("%lld*%lld=%lld\n",i,j,i*j);
		}
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int main() {
#ifdef _DEBUG
	printf( "debug\n" );
#endif
	for ( int i = 1; i < 10; i++ ) {
		for ( int j = 1; j < 10; j++ ) {
			printf( "%dx%d=%d\n ", i, j, i * j );
		}
	}
	return 0;
}

C++: class Main {
	public static void main(String[] args) {
		for (int i = 1; i <= 9; i++)
			for (int j = 1; j <= 9; j++)
				System.out.println(i + "x" + j + "=" + (i * j));
	}
}

C++: #include<iostream>

int main(){
	int a,b;
	for(a=1;a<=9;a++){
		for(b=1;b<=9;b++){
			std::cout<<a<<"x"<<b<<"="<<a*b<<std::endl;
			}
		}
	sys
    return 0;
}

C++: #include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	((v).begin(), (v).end())
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	repp(i,1,10)printf("%dx%d=%d\n",i,i,i*i);
	
	return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
	int i = 0;
	int j = 0;

	for(i=1;i<10;i++){
		for(j=1;j<10;j++){
			printf("%d\n",i*j);
		}
	}
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int t=73000;
	for(int i=t;i;i--){
		for(int j=max(i,9);j;j--){
			if(i<10&&j<10)cout<<10-i<<"x"<<10-j<<"="<<(10-i)*(10-j)<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
    for ( int i = 1; i <= 9; ++ i ) {
        for ( int j = 1; j <= 9; ++ j ) {
            cout << i << "x" << j << "=" << i * j << endl;
        }
    }
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
  for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= 9; j++) {
      printf("%dx%d=%d\n", i, j, i * j);
    }
  }
}

C++: #include <iostream>
int main() {
	int n = 0, m = 0;
	for (int i = 1; i <= 9; i++) {
		for (int j = 1; j <= 9; j++) {
			std::cout << i << "x" << j << "=" << i*j << std::endl;
		}
	}
}

C++: #include <iostream>
using namespace std;

int main(){

	for(int i = 1; i < 10; ++i){
		for(int j = 1; j < 10; ++j){

			cout << i << 'x' << j << "=" << i * j << '\n';
		}

	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int na,ma;
struct node
{
    int p,r,d;
}job[110];
const int maxn=1000;
struct Edge
{
    int from,to,cap,flow;
};
struct Dinic
{

    int s,t,m;
    vector<Edge> edges;
    vector<int> G[maxn];
    bool vis[maxn];
    int d[maxn];
    int cur[maxn];
    void init(int n)
    {
        for (int i=0;i<=n;i++){
            G[i].clear();
        }
        edges.clear();
    }
    void addedge(int from,int to,int cap)
    {
        edges.push_back((Edge){from,to,cap,0});
        edges.push_back((Edge){to,from,0,0});
        m=edges.size();
        G[from].push_back(m-2);
        G[to].push_back(m-1);
    }
    bool bfs(){
        memset(vis,0,sizeof vis);
        queue<int>Q;
        Q.push(s);
        d[s]=0;
        vis[s]=1;
        while (!Q.empty())
        {
            int u=Q.front();Q.pop();
            //cout<<u<<endl;
            for (int i=0;i<G[u].size();i++){
                Edge& e=edges[G[u][i]];
                if (!vis[e.to] && e.cap>e.flow){
                    vis[e.to]=1;
                    d[e.to]=d[u]+1;
                    Q.push(e.to);
                }
               // if (e.cap>e.flow)
              //  cout<<e.to<<" "<<e.cap<<" "<<e.flow<<endl;
            }
        }
        return vis[t];
    }
    int DFS(int x,int a)
    {
        cout<<x<<endl;
        if (x==t || a==0 ) return a;
        int flow=0,f;
        for (int&i=cur[x];i<G[x].size();i++){
            Edge& e =edges[G[x][i]];
            if (d[x]+1==d[e.to] && (f=DFS(e.to,min(a,e.cap-e.flow))>0)){
               //cout<<e.cap-e.flow<<" qwer "<<endl;
                e.flow+=f;
                edges[G[x][i]^1].flow-=f;
                flow+=f;
                cout<<x<<" "<<e.to<<" @@@ "<<flow<<endl;
                a-=f;
                if (a==0) break;
            }
        }
        return flow;
    }
    int maxflow(int s,int t){
        this->s=s;this->t=t;
        int flow=0;
        while (bfs()){
            memset(cur,0,sizeof cur);
            cout<<"============"<<endl;
            flow+=DFS(s,10000000);
            cout<<"flow"<<endl;
            cout<<flow<<endl;
            cout<<"------------"<<endl;
        }
        return flow;
    }
}dinic;
int main()
{
    int ta;
    scanf("%d",&ta);
    while (ta--)
    {
        scanf("%d%d",&na,&ma);
        int cur=0;
        for (int i=1;i<=na;i++){
            scanf("%d%d%d",&job[i].p,&job[i].r,&job[i].d);
            cur+=job[i].p;
        }
        if (ma>=na){
            puts("Boss xnby is happy!");
            continue;
        }
        dinic.init(maxn-1);
        for (int i=1;i<=na;i++){
            dinic.addedge(0,i,job[i].p);
        }
        for (int i=1;i<=na;i++){
            for (int j=job[i].r;j<=job[i].d;j++){
                dinic.addedge(i,200+j,1);
            }
        }
        for (int i=1;i<=200;i++){
            dinic.addedge(200+i,maxn-1,ma);
        }
        int res=dinic.maxflow(0,maxn-1);
        cout<<res<<endl;
        cout<<cur<<endl;
        if (res>=cur){
             puts("Boss xnby is happy!");
        }
        else{
            puts("Boss xnby is angry!");
        }
    }
    return 0;
}