#include <iostream>
using namespace std;
int main() 
{
    int MAXVAL = 11, COLS=3, display, nearest3;
    if (MAXVAL % 3 > 0)
       nearest3 = MAXVAL + (3 - MAXVAL % 3);
    else
       nearest3 = MAXVAL;
       
    cout << "nearest3 is " << nearest3 << endl;
    int ROWS = nearest3/COLS;
    cout << "ROWS is " << ROWS << endl;
    
    for(int r=1; r<=ROWS; r++) {
    	    if(r+(nearest3/COLS)*2 <= MAXVAL)
    		   cout << r << " " << r+(nearest3/COLS) << " " << r+(nearest3/COLS)*2 << endl ;
            else if(r+(nearest3/COLS) <= MAXVAL)
    		        cout << r << " " << r+(nearest3/COLS) << " " << endl ;
                 else
                    cout << r << " " << endl ;
    }
	return 0;
}
