Vasya has his favourite number $$$n$$$. He wants to split it to some non-zero digits. It means, that he wants to choose some digits $$$d_1, d_2, \ldots, d_k$$$, such that $$$1 \leq d_i \leq 9$$$ for all $$$i$$$ and $$$d_1 + d_2 + \ldots + d_k = n$$$.Vasya likes beauty in everything, so he wants to find any solution with the minimal possible number of different digits among $$$d_1, d_2, \ldots, d_k$$$. Help him!

The first line contains a single integer $$$n$$$ — the number that Vasya wants to split ($$$1 \leq n \leq 1000$$$).

In the first line print one integer $$$k$$$ — the number of digits in the partition. Note that $$$k$$$ must satisfy the inequality $$$1 \leq k \leq n$$$. In the next line print $$$k$$$ digits $$$d_1, d_2, \ldots, d_k$$$ separated by spaces. All digits must satisfy the inequalities $$$1 \leq d_i \leq 9$$$. You should find a partition of $$$n$$$ in which the number of different digits among $$$d_1, d_2, \ldots, d_k$$$ will be minimal possible among all partitions of $$$n$$$ into non-zero digits. Among such partitions, it is allowed to find any. It is guaranteed that there exists at least one partition of the number $$$n$$$ into digits.

NoteIn the first test, the number $$$1$$$ can be divided into $$$1$$$ digit equal to $$$1$$$.In the second test, there are $$$3$$$ partitions of the number $$$4$$$ into digits in which the number of different digits is $$$1$$$. This partitions are $$$[1, 1, 1, 1]$$$, $$$[2, 2]$$$ and $$$[4]$$$. Any of these partitions can be found. And, for example, dividing the number $$$4$$$ to the digits $$$[1, 1, 2]$$$ isn't an answer, because it has $$$2$$$ different digits, that isn't the minimum possible number.

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
	};
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  var output = new Array(N);
  for(var i = 0; i < N; i++){
    output[i] = 1;
  }
  myout(N);
  myout(myconv(output, 8));
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', (d) => {
  let n = +d;
  let divider = 9;

  while(n % divider !== 0) {
    divider--;
  }

  console.log(n / divider);
  console.log(new Array(n / divider).fill(divider).join(' '));
});

var N = 0;
var readliner = require('readline');
var rl = readliner.createInterface(process.stdin, process.stdout, null);
rl.on('line', function (cmd) {
                  //console.log('You just typed: '+cmd);
                  N = parseInt(cmd);
              }).on('close', main);

function main() {
    //console.log('goodbye!');

/*    var mn = 1000000000;
    for (var code=0; code<(1<<9); code++) {
	var cnt_ones = 0;
	for (var j=0; j<9; j++) cnt_ones += (code>>j)&1;
        var x = N;

    }*/

    console.log(N);
    var ans = "";
    for (var j=0; j<N; j++) ans += "1 ";
    console.log(ans);

    //var x = 1.2345678;
    //console.log('x = ',Number(x).toFixed(5));

    process.exit(0);
};

//var lines = data.split(/\r?\n/);

var n = +readline();

print(n);
var res = '';
for(var i = 0; i < n; i++) {
   res += '1 ';
}
print(res);

function main(n){

      print(n);
      var ans = ""
      for(var i = 0 ; i < n ; i++){
        ans += "1 ";
      }

      print(ans);
}

var n = parseInt(readline());

main(n);

var k = Number(readline())
var arr = new Array(k).fill(1)
print(k)
print(arr.join(" "))

var n = parseInt(readline());
write(n + "\n");
write(Array(n).fill(1).join(" "));

var taka = parseInt(readline());
print(taka);

for (var i = 1; i <= taka; i++) {
    print(1 + ' ');
}

var num = parseInt(readline());
print(num);
for(var i = 1; i <= num; i++){
    print(1 + ' ');
}

//var input = readline();
var T = parseInt(readline());

print(T);
for(var i=0; i<T; i++) {
     print(1 +' ');
}

//

//var input = readline()
var n = parseInt(readline())

print(n)
var arr = new Array(n).fill(1)
print(arr.join(' '))

//

var t = parseInt(readline())

print(t)
for(var i=0; i<t; i++) {
    write(1 +' ')
}

function ansa(num){

    var bolur = Infinity;
    var anse = ""
    if(num === 1){
      print("1")
      print("1")
      return;
    }
    for(var i = 2 ; i < num ; i++){
      if(num % i === 0 && bolur > i ){
        bolur = i;
      }
    }
    print(bolur);
    for(var i = 0 ; i < bolur ; i++){
      anse = anse + (num/bolur) + " "
    }
    print(anse);

}

var line = readline();
// for(var i = 0 ; i < line.length ; i++) line[i] = parseInt(line[i]);
// var line2 = readline().split(' ');
// for(var i = 0 ; i < line2.length ; i++) line2[i] = parseInt(line2[i]);

ansa(parseInt(line));

var n = parseInt(readline());
var max = Math.min(9, n);
var nums = parseInt(n / max);
var results = new Array(nums).fill(max);
if (n % max !== 0) {
    nums++;
    results.push(n % max);
}

write(results.length);
write(results.join(" "));

var n = parseInt(readline());
var max = Math.min(9, n);
var nums = parseInt(n / max);
var results = new Array(nums).fill(max);
if (n % max !== 0) {
    nums++;
    results.push(n % max);
}

write(results.length + "\n");
write(results.join(" "));


Professor GukiZ is concerned about making his way to school, because massive piles of boxes are blocking his way. In total there are n piles of boxes, arranged in a line, from left to right, i-th pile (1 ≤ i ≤ n) containing ai boxes. Luckily, m students are willing to help GukiZ by removing all the boxes from his way. Students are working simultaneously. At time 0, all students are located left of the first pile. It takes one second for every student to move from this position to the first pile, and after that, every student must start performing sequence of two possible operations, each taking one second to complete. Possible operations are: If i ≠ n, move from pile i to pile i + 1; If pile located at the position of student is not empty, remove one box from it.GukiZ's students aren't smart at all, so they need you to tell them how to remove boxes before professor comes (he is very impatient man, and doesn't want to wait). They ask you to calculate minumum time t in seconds for which they can remove all the boxes from GukiZ's way. Note that students can be positioned in any manner after t seconds, but all the boxes must be removed.

The first line contains two integers n and m (1 ≤ n, m ≤ 105), the number of piles of boxes and the number of GukiZ's students.  The second line contains n integers a1, a2, ... an (0 ≤ ai ≤ 109) where ai represents the number of boxes on i-th pile. It's guaranteed that at least one pile of is non-empty.

In a single line, print one number, minimum time needed to remove all the boxes in seconds.

NoteFirst sample: Student will first move to the first pile (1 second), then remove box from first pile (1 second), then move to the second pile (1 second) and finally remove the box from second pile (1 second).Second sample: One of optimal solutions is to send one student to remove a box from the first pile and a box from the third pile, and send another student to remove a box from the third pile. Overall, 5 seconds.Third sample: With a lot of available students, send three of them to remove boxes from the first pile, four of them to remove boxes from the second pile, five of them to remove boxes from the third pile, and four of them to remove boxes from the fourth pile. Process will be over in 5 seconds, when removing the boxes from the last pile is finished.

function ProblemSolver() {
    this.HAS_TEST_CASES = false;
    this.INPUT_FILE_NAME = "test.in";
    this.OUTPUT_FILE_NAME = "out.txt";
    this.DO_OUTPUT_TO_FILE = false;
    this.CLEAR_ARRAY_PER_CASE = false;

    this.solveCase = function() {
        var res , i , j , fl , cn , temp , lo , hi , mi , fl , crr ;
        res = 0 ;
        lo = 0 ;
        hi = 1000000000000000 ;
        while( lo <= hi ) {
        	mi = Math.floor( ( lo + hi ) / 2 ) ;
        	for( i = 0 ; i <= this.m ; i++ ) {
        		this.brr[ i ] = mi ;
        	}
        	crr = [] ;
        	for( i = 0 ; i < this.n ; i++ ) {
        		crr.push( this.arr[ i ] ) ;
        	}
        	j = this.m ;
        	fl = 1 ;
        	for( i = this.n - 1 ; i >= 0 ; i-- ) {
        		if( fl == 0 ) {
        			break ;
        		}
        		while( true ) {
        			if( crr[ i ] > 0 ) {
        				if( j <= 0 ) {
        					fl = 0 ;
        					break ;
        				}
        				if( this.brr[ j ] == 0 ) {
        					j-- ;
        					continue ;
        				}
        				if( this.brr[ j ] == mi ) {
        					if( this.brr[ j ] < i + 1 ) {
        						this.brr[ j ] = 0 ;
        						j-- ;
        						continue ;
        					}
        					this.brr[ j ] -= i + 1 ;
        				}
        				if( this.brr[ j ] == 0 ) {
        					j-- ;
        					continue ;
        				}
        				if( this.brr[ j ] <= crr[ i ] ) {
        					crr[ i ] -= this.brr[ j ] ;
        					this.brr[ j ] = 0 ;
        					j-- ;
        				}
        				else {
        					this.brr[ j ] -= crr[ i ] ;
        					crr[ i ] = 0 ;
        				}
        			}
        			else {
        				break ;
        			}
        		}
        	}
        	for( i = this.n - 1 ; i >= 0 ; i-- ) {
        		if( crr[ i ] > 0 ) {
        			fl = 0 ;
        			break ;
        		}
        	}
        	if( fl == 1 ) {
    			hi = mi - 1 ;
    			res = mi ;
    		}
    		else {
    			lo = mi + 1 ;
    		}
        }
        print( res ) ;
    };

    this.init = function() {
        this.lim1 = 100010;
        this.lim2 = 110;
        this.cc = 1;
        this.ind = 1;
        this.n = 0;
        this.cn = 0;
        this.declareAndFillArrays();
    };

    this.getInput = function( irObj ) {
        var hasMoreInput , i;
        hasMoreInput = true;
        try {
            this.n = irObj.nextInt();
            this.m = irObj.nextInt();
            this.arr = [] ;
            for( i = 0 ; i < this.n ; i++ ) {
                this.arr.push( irObj.nextInt() ) ;
            }
        }
        catch( ex ) {
            hasMoreInput = false;
        }
        return hasMoreInput;
    };

    this.clearArraysPerCase = function() {
        var i;
        this.arr = new Array();
        this.adjList = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.arr.push( 0 );
            this.adjList.push( new Array() );
        }
    };

    this.clearPerCase = function() {
        this.cn = 0;
        this.cc++;
        if( this.CLEAR_ARRAY_PER_CASE == true ) {
            this.clearArraysPerCase() ;
        }
    };

    this.declareAndFillArrays = function() {
        var i , j;
        this.srr = new Array();
        this.vis = new Array();
        this.arr = new Array();
        this.brr = new Array();
        this.memo = new Array();
        this.done = new Array();
        this.adjList = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.srr.push( "" );
            this.vis.push( 0 );
            this.arr.push( 0 );
            this.brr.push( 0 );
            this.adjList.push( new Array() );
        }
        for( i = 0 ; i < this.lim2 ; i++ ) {
            this.memo.push( new Array() );
            this.done.push( new Array() );
            for( j = 0 ; j < this.lim2 ; j++ ) {
                this.memo[ i ].push( -1 );
                this.done[ i ].push( 0 );
            }
        }
    };

    this.init();
}

function InputReader() {
    var self = this ;
    this.allLines = new Array();
    this.currrentLineNumber = 0;
    this.currrentCharacterIndex = 0;
    this.callBackFunction = null ;
    this.parentContext = null ;

    this.readAllLines = function() {
        var singleLine;
        while( true ) {
            try {
                singleLine = readline();
                if( singleLine == null ) {
                    break;
                }
            }
            catch( ex ) {
                break;
            }
            this.allLines.push( singleLine );
        }
    };

    this.readAllLinesFromRhino = function() {
        var brObj , line ;
        importPackage( java.io ) ;
        importPackage( java.lang ) ;
        brObj = new BufferedReader( new InputStreamReader( System[ 'in' ] ) ) ;
        this.allLines = [] ;
        while( true ) {
            line = brObj.readLine() ;
            if( line == null ) {
                break;
            }
            this.allLines.push( line ) ;
        }
    };

    this.readSingleLinesFromNodeJsJudgeServer = function( chunk ) {
        self.chunkData += chunk ;
    };

    this.readEndFromNodeJsJudgeServer = function() {
        self.parseRawData( self.chunkData ) ;
        self.parentContext.runCases() ;
    };

    this.readAllLinesFromNodeJsJudgeServer = function( parentContext ) {
        this.parentContext = parentContext ;
        process.stdin.resume() ;
        process.stdin.setEncoding( 'utf8' ) ;
        this.chunkData = '' ;
        process.stdin.on( 'data' , this.readSingleLinesFromNodeJsJudgeServer ) ;
        process.stdin.on( 'end' , this.readEndFromNodeJsJudgeServer ) ;
    };

    this.parseRawData = function( data ) {
        var len , i , currentString;
        len = data.length;
        currentString = "";
        this.allLines = [] ;
        for( i = 0 ; i < len ; i++ ) {
            if( data[ i ] == '\r' ) {
            }
            else if( data[ i ] == '\n' ) {
                this.allLines.push( currentString );
                currentString = "";
            }
            else {
                currentString += data[ i ];
            }
        }
        if( currentString != "" ) {
            this.allLines.push( currentString );
        }
    };

    this.readAllLinesFromFile = function( inputFileName ) {
        var currentDirectory , fsObj , inputFilePath , rawData;
        fsObj = require( 'fs' );
        currentDirectory = __dirname;
        inputFilePath = currentDirectory + "\\" + inputFileName;
        rawData = fsObj.readFileSync( inputFilePath , "utf8" );
        this.parseRawData( rawData );
    };

    this.next = function( flag ) {
        var len , i , startIdx , res , endIdx;
        if( flag == 0 ) {
            if( this.currrentCharacterIndex != 0 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
            }
            res = "";
            len = this.allLines[ this.currrentLineNumber ].length;
            if( typeof( len ) == 'function' ) {
                len = this.allLines[ this.currrentLineNumber ].length() ;
            }
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                res += '' + this.allLines[ this.currrentLineNumber ].charAt( i ) ;
            }
            this.currrentLineNumber++;
            this.currrentCharacterIndex = 0;
            return res;
        }
        while( true ) {
            if( this.currrentLineNumber >= this.allLines.length ) {
                throw new Error( "No more tokens available!" );
            }
            startIdx = -1;
            len = this.allLines[ this.currrentLineNumber ].length;
            if( typeof( len ) == 'function' ) {
                len = this.allLines[ this.currrentLineNumber ].length() ;
            }
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) != ' '.charCodeAt( 0 ) ) {
                    startIdx = i;
                    break;
                }
            }
            if( startIdx == -1 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
                continue;
            }
            res = "";
            endIdx = len - 1 ;
            for( i = startIdx ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) == ' '.charCodeAt( 0 ) ) {
                    endIdx = i;
                    break;
                }
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) >= 48 && this.allLines[ this.currrentLineNumber ].charCodeAt( i ) <= 57 ) {
                    res += '' + ( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) - 48 ) ;
                }
                else {
                    res += '' + this.allLines[ this.currrentLineNumber ].charAt( i );
                }
            }
            this.currrentCharacterIndex = endIdx;
            if( endIdx == len - 1 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
            }
            return res;
        }
    };

    this.nextInt = function() {
        return parseInt( this.next( 1 ) );
    };

    this.nextDouble = function() {
        return parseFloat( this.next( 1 ) );
    };

    this.nextString = function() {
        return this.next( 1 );
    };

    this.nextLine = function() {
        return this.next( 0 );
    };
}

function FileOutputHandler() {
    this.resultantStringArray = new Array();

    this.addNewLine = function( newString ) {
        this.resultantStringArray.push( newString );
    };

    this.clearPercase = function() {
        this.resultantStringArray = new Array();
    };

    this.flushOutOutputToFile = function( outputFileName ) {
        var i , sz , res , currentDirectory , fsObj , outputFilePath;
        res = "";
        sz = this.resultantStringArray.length;
        for( i = 0 ; i < sz ; i++ ) {
            if( i != 0 ) {
                res += "\n";
            }
            res += this.resultantStringArray[ i ];
        }
        fsObj = require( 'fs' );
        currentDirectory = __dirname;
        outputFilePath = currentDirectory + "\\" + outputFileName;
        fsObj.writeFileSync( outputFilePath , res );
        this.clearPercase();
    };
}

function CodeExecutioner() {
    this.irObj = new InputReader();
    this.psObj = new ProblemSolver();
    this.fohObj = new FileOutputHandler();

    this.runCases = function() {
        if( this.psObj.HAS_TEST_CASES == true ) {
            testCases = this.irObj.nextInt();
            for( i = 0 ; i < testCases ; i++ ) {
                this.psObj.clearPerCase();
                this.psObj.getInput( this.irObj );
                this.psObj.solveCase();
            }
        }
        else {
            while( true ) {
                this.psObj.clearPerCase();
                hasMoreTestCases = this.psObj.getInput( this.irObj );
                if( hasMoreTestCases == false ) {
                    break;
                }
                this.psObj.solveCase();
            }
        }
        if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
            this.fohObj.flushOutOutputToFile( this.psObj.OUTPUT_FILE_NAME );
        }
    };

    this.detectEnvironmentType = function() {
        var environmentType = null ;
        try {
            if( importPackage != null ) {
                environmentType = 'rhino' ;
            }
        }
        catch( ex1 ) {
            try {
                //for nodejs local server check
                if( __dirname != null && readline != null && typeof( readline ) != 'function' ) {
                    environmentType = 'local-node-js' ;
                }
            }
            catch( ex2 ) {
                try {
                    if( readline == null || typeof( readline ) != 'function' ) {
                        environmentType = 'server-node-js' ;
                    }
                    else {
                        try {
                            if( Map != null ) {
                                environmentType = 'spider-monkey' ;
                            }
                            else {
                                environmentType = 'javascript-v8' ;
                            }
                        }
                        catch( ex3 ) {
                            environmentType = 'javascript-v8' ;
                        }
                    }
                }
                catch( ex3 ) {
                    environmentType = 'server-node-js' ;
                }
            }
        }
        return environmentType ;
    };

    this.configureStreamsAndReadInput = function() {
        var testCases , i , hasMoreTestCases , isLocal , localContext , isNodeJsJudgeServer , environmentType ;
        isNodeJsJudgeServer = false ;
        environmentType = this.detectEnvironmentType() ;
        if( environmentType == 'local-node-js' ) {
            try {
                if( print == null || typeof( print ) != 'function' ) {
                    print = console.log;
                }
            }
            catch( ex ) {
                print = console.log;
            }
            if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
                localContext = this.fohObj;
                print = function() {
                    localContext.addNewLine.apply( localContext , arguments );
                }
            }
            this.irObj.readAllLinesFromFile( this.psObj.INPUT_FILE_NAME );
            this.runCases() ;
        }
        else if( environmentType == 'server-node-js' ) {
            try {
                if( print == null || typeof( print ) != 'function' ) {
                    print = console.log;
                }
            }
            catch( ex ) {
                print = console.log;
            }
            this.irObj.readAllLinesFromNodeJsJudgeServer( this ) ;
        }
        else if( environmentType == 'javascript-v8' ) {
            this.irObj.readAllLines();
            this.runCases() ;
        }
        else if( environmentType == 'rhino' ) {
            this.irObj.readAllLinesFromRhino();
            this.runCases() ;
        }
        else if( environmentType == 'spider-monkey' ) {
            this.irObj.readAllLines();
            this.runCases() ;
        }
    };

    this.configureStreamsAndReadInput();
}

new CodeExecutioner();

// GukiZ

function main_1(){
    var n = parseInt(readline());
    var ans = 0;
    while (n--) {
        var nums = readline().split(' ').map(Number);
        ans += (nums[2] - nums[0] + 1) * (nums[3] - nums[1] + 1);
    }
    print(ans);
}

function main(){
    var line  = readline();
    //var line = prompt();
    var n = line.length;
    //alert(line);
    var m = 0;
    for(i=0;i<n;i+=2){
        for(j=i+1;j<n;j+=2){
            var ex = [line.slice(0, i), '(', line.slice(i,j) , ')' , line.slice(j)].join('');
            m = Math.max(m,eval(ex));
        }
    }
    print(m);
}

// var n = parseInt(readline());
var input_line = readline().split(' ').map(Number);
var n = input_line[0];
var m = input_line[1];

var arr = readline().split(' ').map(Number);

while (arr[n-1] == 0) {
    arr.pop();
    n --;
}
/*
n = m = 100000;
for (i=0; i < n; i++) {
    arr[$i] = '10';
}
*/

var o_min = 0;
var o_max = 1000000000000000;

var time = 0;
var arr_kor = [];
var posNotNull = 0;
var time_tmp = 0;

while (o_max - o_min > 1) {

    time = Math.round((o_min + o_max) / 2);

    arr_kor = arr.slice();
    posNotNull = 0;
    for (i=1; i <= m; i++) {

        time_tmp = time - posNotNull;
        for (j=posNotNull; j < n; j++) {
            time_tmp --;

            if (arr_kor[j] == 0) {
                posNotNull ++;
                continue;
            }

            if (arr_kor[j] < time_tmp) {
                time_tmp -= arr_kor[j];
                arr_kor[j] = 0;
            } else {
                arr_kor[j] -= time_tmp;
                break;
            }
        }
        if (arr_kor[n-1] == 0) break;
    }

    if (arr_kor[n-1] == 0) {
        o_max = time;
    } else {
        o_min = time;
    }

}

print(o_max);

function ProblemSolver() {
    this.HAS_TEST_CASES = false;
    this.INPUT_FILE_NAME = "test.in";
    this.OUTPUT_FILE_NAME = "out.txt";
    this.DO_OUTPUT_TO_FILE = false;
    this.CLEAR_ARRAY_PER_CASE = false;

    this.solveCase = function() {
        var res , i , j , fl , cn , temp , lo , hi , mi , fl , crr ;
        res = 0 ;
        lo = 0 ;
        hi = 100000000000000 ;
        while( lo <= hi ) {
        	mi = Math.floor( ( lo + hi ) / 2 ) ;
        	for( i = 0 ; i <= this.m ; i++ ) {
        		this.brr[ i ] = mi ;
        	}
        	crr = [] ;
        	for( i = 0 ; i < this.n ; i++ ) {
        		crr.push( this.arr[ i ] ) ;
        	}
        	j = this.m ;
        	fl = 1 ;
        	for( i = this.n - 1 ; i >= 0 ; i-- ) {
        		if( fl == 0 ) {
        			break ;
        		}
        		while( true ) {
        			if( crr[ i ] > 0 ) {
        				if( j <= 0 ) {
        					fl = 0 ;
        					break ;
        				}
        				if( this.brr[ j ] == 0 ) {
        					j-- ;
        					continue ;
        				}
        				if( this.brr[ j ] == mi ) {
        					if( this.brr[ j ] < i + 1 ) {
        						this.brr[ j ] = 0 ;
        						j-- ;
        						continue ;
        					}
        					this.brr[ j ] -= i + 1 ;
        				}
        				if( this.brr[ j ] == 0 ) {
        					j-- ;
        					continue ;
        				}
        				if( this.brr[ j ] <= crr[ i ] ) {
        					crr[ i ] -= this.brr[ j ] ;
        					this.brr[ j ] = 0 ;
        					j-- ;
        				}
        				else {
        					this.brr[ j ] -= crr[ i ] ;
        					crr[ i ] = 0 ;
        				}
        			}
        			else {
        				break ;
        			}
        		}
        	}
        	for( i = this.n - 1 ; i >= 0 ; i-- ) {
        		if( crr[ i ] > 0 ) {
        			fl = 0 ;
        			break ;
        		}
        	}
        	if( fl == 1 ) {
    			hi = mi - 1 ;
    			res = mi ;
    		}
    		else {
    			lo = mi + 1 ;
    		}
        }
        print( res ) ;
    };

    this.init = function() {
        this.lim1 = 100010;
        this.lim2 = 110;
        this.cc = 1;
        this.ind = 1;
        this.n = 0;
        this.cn = 0;
        this.declareAndFillArrays();
    };

    this.getInput = function( irObj ) {
        var hasMoreInput , i;
        hasMoreInput = true;
        try {
            this.n = irObj.nextInt();
            this.m = irObj.nextInt();
            this.arr = [] ;
            for( i = 0 ; i < this.n ; i++ ) {
                this.arr.push( irObj.nextInt() ) ;
            }
        }
        catch( ex ) {
            hasMoreInput = false;
        }
        return hasMoreInput;
    };

    this.clearArraysPerCase = function() {
        var i;
        this.arr = new Array();
        this.adjList = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.arr.push( 0 );
            this.adjList.push( new Array() );
        }
    };

    this.clearPerCase = function() {
        this.cn = 0;
        this.cc++;
        if( this.CLEAR_ARRAY_PER_CASE == true ) {
            this.clearArraysPerCase() ;
        }
    };

    this.declareAndFillArrays = function() {
        var i , j;
        this.srr = new Array();
        this.vis = new Array();
        this.arr = new Array();
        this.brr = new Array();
        this.memo = new Array();
        this.done = new Array();
        this.adjList = new Array();
        for( i = 0 ; i < this.lim1 ; i++ ) {
            this.srr.push( "" );
            this.vis.push( 0 );
            this.arr.push( 0 );
            this.brr.push( 0 );
            this.adjList.push( new Array() );
        }
        for( i = 0 ; i < this.lim2 ; i++ ) {
            this.memo.push( new Array() );
            this.done.push( new Array() );
            for( j = 0 ; j < this.lim2 ; j++ ) {
                this.memo[ i ].push( -1 );
                this.done[ i ].push( 0 );
            }
        }
    };

    this.init();
}

function InputReader() {
    var self = this ;
    this.allLines = new Array();
    this.currrentLineNumber = 0;
    this.currrentCharacterIndex = 0;
    this.callBackFunction = null ;
    this.parentContext = null ;

    this.readAllLines = function() {
        var singleLine;
        while( true ) {
            try {
                singleLine = readline();
                if( singleLine == null ) {
                    break;
                }
            }
            catch( ex ) {
                break;
            }
            this.allLines.push( singleLine );
        }
    };

    this.readAllLinesFromRhino = function() {
        var brObj , line ;
        importPackage( java.io ) ;
        importPackage( java.lang ) ;
        brObj = new BufferedReader( new InputStreamReader( System[ 'in' ] ) ) ;
        this.allLines = [] ;
        while( true ) {
            line = brObj.readLine() ;
            if( line == null ) {
                break;
            }
            this.allLines.push( line ) ;
        }
    };

    this.readSingleLinesFromNodeJsJudgeServer = function( chunk ) {
        self.chunkData += chunk ;
    };

    this.readEndFromNodeJsJudgeServer = function() {
        self.parseRawData( self.chunkData ) ;
        self.parentContext.runCases() ;
    };

    this.readAllLinesFromNodeJsJudgeServer = function( parentContext ) {
        this.parentContext = parentContext ;
        process.stdin.resume() ;
        process.stdin.setEncoding( 'utf8' ) ;
        this.chunkData = '' ;
        process.stdin.on( 'data' , this.readSingleLinesFromNodeJsJudgeServer ) ;
        process.stdin.on( 'end' , this.readEndFromNodeJsJudgeServer ) ;
    };

    this.parseRawData = function( data ) {
        var len , i , currentString;
        len = data.length;
        currentString = "";
        this.allLines = [] ;
        for( i = 0 ; i < len ; i++ ) {
            if( data[ i ] == '\r' ) {
            }
            else if( data[ i ] == '\n' ) {
                this.allLines.push( currentString );
                currentString = "";
            }
            else {
                currentString += data[ i ];
            }
        }
        if( currentString != "" ) {
            this.allLines.push( currentString );
        }
    };

    this.readAllLinesFromFile = function( inputFileName ) {
        var currentDirectory , fsObj , inputFilePath , rawData;
        fsObj = require( 'fs' );
        currentDirectory = __dirname;
        inputFilePath = currentDirectory + "\\" + inputFileName;
        rawData = fsObj.readFileSync( inputFilePath , "utf8" );
        this.parseRawData( rawData );
    };

    this.next = function( flag ) {
        var len , i , startIdx , res , endIdx;
        if( flag == 0 ) {
            if( this.currrentCharacterIndex != 0 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
            }
            res = "";
            len = this.allLines[ this.currrentLineNumber ].length;
            if( typeof( len ) == 'function' ) {
                len = this.allLines[ this.currrentLineNumber ].length() ;
            }
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                res += '' + this.allLines[ this.currrentLineNumber ].charAt( i ) ;
            }
            this.currrentLineNumber++;
            this.currrentCharacterIndex = 0;
            return res;
        }
        while( true ) {
            if( this.currrentLineNumber >= this.allLines.length ) {
                throw new Error( "No more tokens available!" );
            }
            startIdx = -1;
            len = this.allLines[ this.currrentLineNumber ].length;
            if( typeof( len ) == 'function' ) {
                len = this.allLines[ this.currrentLineNumber ].length() ;
            }
            for( i = this.currrentCharacterIndex ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) != ' '.charCodeAt( 0 ) ) {
                    startIdx = i;
                    break;
                }
            }
            if( startIdx == -1 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
                continue;
            }
            res = "";
            endIdx = len - 1 ;
            for( i = startIdx ; i < len ; i++ ) {
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) == ' '.charCodeAt( 0 ) ) {
                    endIdx = i;
                    break;
                }
                if( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) >= 48 && this.allLines[ this.currrentLineNumber ].charCodeAt( i ) <= 57 ) {
                    res += '' + ( this.allLines[ this.currrentLineNumber ].charCodeAt( i ) - 48 ) ;
                }
                else {
                    res += '' + this.allLines[ this.currrentLineNumber ].charAt( i );
                }
            }
            this.currrentCharacterIndex = endIdx;
            if( endIdx == len - 1 ) {
                this.currrentLineNumber++;
                this.currrentCharacterIndex = 0;
            }
            return res;
        }
    };

    this.nextInt = function() {
        return parseInt( this.next( 1 ) );
    };

    this.nextDouble = function() {
        return parseFloat( this.next( 1 ) );
    };

    this.nextString = function() {
        return this.next( 1 );
    };

    this.nextLine = function() {
        return this.next( 0 );
    };
}

function FileOutputHandler() {
    this.resultantStringArray = new Array();

    this.addNewLine = function( newString ) {
        this.resultantStringArray.push( newString );
    };

    this.clearPercase = function() {
        this.resultantStringArray = new Array();
    };

    this.flushOutOutputToFile = function( outputFileName ) {
        var i , sz , res , currentDirectory , fsObj , outputFilePath;
        res = "";
        sz = this.resultantStringArray.length;
        for( i = 0 ; i < sz ; i++ ) {
            if( i != 0 ) {
                res += "\n";
            }
            res += this.resultantStringArray[ i ];
        }
        fsObj = require( 'fs' );
        currentDirectory = __dirname;
        outputFilePath = currentDirectory + "\\" + outputFileName;
        fsObj.writeFileSync( outputFilePath , res );
        this.clearPercase();
    };
}

function CodeExecutioner() {
    this.irObj = new InputReader();
    this.psObj = new ProblemSolver();
    this.fohObj = new FileOutputHandler();

    this.runCases = function() {
        if( this.psObj.HAS_TEST_CASES == true ) {
            testCases = this.irObj.nextInt();
            for( i = 0 ; i < testCases ; i++ ) {
                this.psObj.clearPerCase();
                this.psObj.getInput( this.irObj );
                this.psObj.solveCase();
            }
        }
        else {
            while( true ) {
                this.psObj.clearPerCase();
                hasMoreTestCases = this.psObj.getInput( this.irObj );
                if( hasMoreTestCases == false ) {
                    break;
                }
                this.psObj.solveCase();
            }
        }
        if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
            this.fohObj.flushOutOutputToFile( this.psObj.OUTPUT_FILE_NAME );
        }
    };

    this.detectEnvironmentType = function() {
        var environmentType = null ;
        try {
            if( importPackage != null ) {
                environmentType = 'rhino' ;
            }
        }
        catch( ex1 ) {
            try {
                //for nodejs local server check
                if( __dirname != null && readline != null && typeof( readline ) != 'function' ) {
                    environmentType = 'local-node-js' ;
                }
            }
            catch( ex2 ) {
                try {
                    if( readline == null || typeof( readline ) != 'function' ) {
                        environmentType = 'server-node-js' ;
                    }
                    else {
                        try {
                            if( Map != null ) {
                                environmentType = 'spider-monkey' ;
                            }
                            else {
                                environmentType = 'javascript-v8' ;
                            }
                        }
                        catch( ex3 ) {
                            environmentType = 'javascript-v8' ;
                        }
                    }
                }
                catch( ex3 ) {
                    environmentType = 'server-node-js' ;
                }
            }
        }
        return environmentType ;
    };

    this.configureStreamsAndReadInput = function() {
        var testCases , i , hasMoreTestCases , isLocal , localContext , isNodeJsJudgeServer , environmentType ;
        isNodeJsJudgeServer = false ;
        environmentType = this.detectEnvironmentType() ;
        if( environmentType == 'local-node-js' ) {
            try {
                if( print == null || typeof( print ) != 'function' ) {
                    print = console.log;
                }
            }
            catch( ex ) {
                print = console.log;
            }
            if( this.psObj.DO_OUTPUT_TO_FILE == true ) {
                localContext = this.fohObj;
                print = function() {
                    localContext.addNewLine.apply( localContext , arguments );
                }
            }
            this.irObj.readAllLinesFromFile( this.psObj.INPUT_FILE_NAME );
            this.runCases() ;
        }
        else if( environmentType == 'server-node-js' ) {
            try {
                if( print == null || typeof( print ) != 'function' ) {
                    print = console.log;
                }
            }
            catch( ex ) {
                print = console.log;
            }
            this.irObj.readAllLinesFromNodeJsJudgeServer( this ) ;
        }
        else if( environmentType == 'javascript-v8' ) {
            this.irObj.readAllLines();
            this.runCases() ;
        }
        else if( environmentType == 'rhino' ) {
            this.irObj.readAllLinesFromRhino();
            this.runCases() ;
        }
        else if( environmentType == 'spider-monkey' ) {
            this.irObj.readAllLines();
            this.runCases() ;
        }
    };

    this.configureStreamsAndReadInput();
}

new CodeExecutioner();

// GukiZ

function main_1(){
    var n = parseInt(readline());
    var ans = 0;
    while (n--) {
        var nums = readline().split(' ').map(Number);
        ans += (nums[2] - nums[0] + 1) * (nums[3] - nums[1] + 1);
    }
    print(ans);
}

function main(){
    var line  = readline();
    //var line = prompt();
    var n = line.length;
    //alert(line);
    var m = 0;
    for(i=0;i<n;i+=2){
        for(j=i+1;j<n;j+=2){
            var ex = [line.slice(0, i), '(', line.slice(i,j) , ')' , line.slice(j)].join('');
            m = Math.max(m,eval(ex));
        }
    }
    print(m);
}

// var n = parseInt(readline());
var input_line = readline().split(' ').map(Number);
var n =  input_line[0];
var m =  input_line[1];

var arr = readline().split(' ').map(Number);

while (arr[n-1] == 0) {
    arr.pop();
    n --;
}
/*
n = m = 100000;
for (i=0; i < n; i++) {
    arr[$i] = '10';
}
*/

var o_min = 0;
var o_max = 385000000;

var time = 0;
var arr_kor = [];
var posNotNull = 0;
var time_tmp = 0;

while (o_max - o_min > 1) {

    time = Math.round((o_min + o_max) / 2);

    arr_kor = arr;
    posNotNull = 0;
    for (i=1; i <= m; i++) {

        time_tmp = time - posNotNull;
        for (j=posNotNull; j < n; j++) {
            time_tmp --;

            if (arr_kor[j] == 0) {
                posNotNull ++;
                continue;
            }

            if (arr_kor[j] < time_tmp) {
                time_tmp -= arr_kor[j];
                arr_kor[j] = 0;
            } else {
                arr_kor[j] -= time_tmp;
                break;
            }
        }
        if (arr_kor[n-1] == 0) break;
    }

    if (arr_kor[n-1] == 0) {
        o_max = time;
    } else {
        o_min = time;
    }

}

print(o_max);

// GukiZ

function main_1(){
    var n = parseInt(readline());
    var ans = 0;
    while (n--) {
        var nums = readline().split(' ').map(Number);
        ans += (nums[2] - nums[0] + 1) * (nums[3] - nums[1] + 1);
    }
    print(ans);
}

function main(){
    var line  = readline();
    //var line = prompt();
    var n = line.length;
    //alert(line);
    var m = 0;
    for(i=0;i<n;i+=2){
        for(j=i+1;j<n;j+=2){
            var ex = [line.slice(0, i), '(', line.slice(i,j) , ')' , line.slice(j)].join('');
            m = Math.max(m,eval(ex));
        }
    }
    print(m);
}

// var n = parseInt(readline());
var input_line = readline().split(' ').map(Number);
var n =  input_line[0];
var m =  input_line[1];

var arr = readline().split(' ').map(Number);

while (arr[n-1] == 0) {
    arr.pop();
    n --;
}
/*
n = m = 100000;
for (i=0; i < n; i++) {
    arr[$i] = '10';
}
*/

var o_min = 0;
var o_max = 2000000000;

var time = 0;
var arr_kor = [];
var posNotNull = 0;
var time_tmp = 0;

while (o_max - o_min > 1) {

    time = Math.round((o_min + o_max) / 2);

    arr_kor = arr.slice();
    posNotNull = 0;
    for (i=1; i <= m; i++) {

        time_tmp = time - posNotNull;
        for (j=posNotNull; j < n; j++) {
            time_tmp --;

            if (arr_kor[j] == 0) {
                posNotNull ++;
                continue;
            }

            if (arr_kor[j] < time_tmp) {
                time_tmp -= arr_kor[j];
                arr_kor[j] = 0;
            } else {
                arr_kor[j] -= time_tmp;
                break;
            }
        }
        if (arr_kor[n-1] == 0) break;
    }

    if (arr_kor[n-1] == 0) {
        o_max = time;
    } else {
        o_min = time;
    }

}

print(o_max);

// GukiZ

function main_1(){
    var n = parseInt(readline());
    var ans = 0;
    while (n--) {
        var nums = readline().split(' ').map(Number);
        ans += (nums[2] - nums[0] + 1) * (nums[3] - nums[1] + 1);
    }
    print(ans);
}

function main(){
    var line  = readline();
    //var line = prompt();
    var n = line.length;
    //alert(line);
    var m = 0;
    for(i=0;i<n;i+=2){
        for(j=i+1;j<n;j+=2){
            var ex = [line.slice(0, i), '(', line.slice(i,j) , ')' , line.slice(j)].join('');
            m = Math.max(m,eval(ex));
        }
    }
    print(m);
}

// var n = parseInt(readline());
var input_line = readline().split(' ').map(Number);
var n =  input_line[0];
var m =  input_line[1];

var arr = readline().split(' ').map(Number);

while (arr[n-1] == 0) {
    arr.pop();
    n --;
}
/*
n = m = 100000;
for (i=0; i < n; i++) {
    arr[$i] = '10';
}
*/

var o_min = 0;
var o_max = 385000000;

var time = 0;
var arr_kor = [];
var posNotNull = 0;
var time_tmp = 0;

while (o_max - o_min > 1) {

    time = Math.round((o_min + o_max) / 2);

    arr_kor = arr.slice();
    posNotNull = 0;
    for (i=1; i <= m; i++) {

        time_tmp = time - posNotNull;
        for (j=posNotNull; j < n; j++) {
            time_tmp --;

            if (arr_kor[j] == 0) {
                posNotNull ++;
                continue;
            }

            if (arr_kor[j] < time_tmp) {
                time_tmp -= arr_kor[j];
                arr_kor[j] = 0;
            } else {
                arr_kor[j] -= time_tmp;
                break;
            }
        }
        if (arr_kor[n-1] == 0) break;
    }

    if (arr_kor[n-1] == 0) {
        o_max = time;
    } else {
        o_min = time;
    }

}

print(o_max);


Polycarp must pay exactly $$$n$$$ burles at the checkout. He has coins of two nominal values: $$$1$$$ burle and $$$2$$$ burles. Polycarp likes both kinds of coins equally. So he doesn't want to pay with more coins of one type than with the other.Thus, Polycarp wants to minimize the difference between the count of coins of $$$1$$$ burle and $$$2$$$ burles being used. Help him by determining two non-negative integer values $$$c_1$$$ and $$$c_2$$$ which are the number of coins of $$$1$$$ burle and $$$2$$$ burles, respectively, so that the total value of that number of coins is exactly $$$n$$$ (i. e. $$$c_1 + 2 \cdot c_2 = n$$$), and the absolute value of the difference between $$$c_1$$$ and $$$c_2$$$ is as little as possible (i. e. you must minimize $$$|c_1-c_2|$$$).

The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of one line. This line contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the number of burles to be paid by Polycarp.

For each test case, output a separate line containing two integers $$$c_1$$$ and $$$c_2$$$ ($$$c_1, c_2 \ge 0$$$) separated by a space where $$$c_1$$$ is the number of coins of $$$1$$$ burle and $$$c_2$$$ is the number of coins of $$$2$$$ burles. If there are multiple optimal solutions, print any one.

NoteThe answer for the first test case is "334 333". The sum of the nominal values of all coins is $$$334 \cdot 1 + 333 \cdot 2 = 1000$$$, whereas $$$|334 - 333| = 1$$$. One can't get the better value because if $$$|c_1 - c_2| = 0$$$, then $$$c_1 = c_2$$$ and $$$c_1 \cdot 1 + c_1 \cdot 2 = 1000$$$, but then the value of $$$c_1$$$ isn't an integer.The answer for the second test case is "10 10". The sum of the nominal values is $$$10 \cdot 1 + 10 \cdot 2 = 30$$$ and $$$|10 - 10| = 0$$$, whereas there's no number having an absolute value less than $$$0$$$.

"use strict";

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let _inputString = '';
let _currentLine = 0;

process.stdin.on('data', inputStdin => {
    _inputString += inputStdin;
});

process.stdin.on('end', _ => {
    _inputString = _inputString.trim().split('\n').map(string => string.trim());
    main();
});

const readLine = () => _inputString[_currentLine++];

const nextIntArray = () => readLine.split(" ").map(x => parseInt(x));
const nextFloatArray = () => readLine.split(" ").map(x => parseFloat(x));
const nextInt = () => parseInt(readLine());

const gcd = (a, b) => a ? gcd(b % a, a) : b;
const lcm = (a, b) => a * b / gcd(a, b);

function print(...args) {
    console.log(...args);
}

function solve() {
    let n = nextInt();
    let a = Math.floor(n / 3);
    let m = n % 3;
    let b = a;
    a += m;
    let c = a - 2;
    let d = b + 1;
    if (Math.abs(a - b) <= Math.abs(c - d)) {
        print(a, b);
    } else {
        print(c, d);
    }
}

function main() {
    let testCases = 1;
    testCases = parseInt(readLine());
    for (let i = 0; i < testCases; i++) {
        solve();
    }
}

process.stdin.resume();

process.stdin.setEncoding("utf8");

let input = "";

process.stdin.on("data", (data) => {
  input += data;
});
process.stdin.on("end", () => {
  main(input);
});

function main(input) {
  input = input.split("\n");
  let z = 0;
  let testCases = parseInt(input[z++], 10);

  while (testCases--) {
    let str = input[z++].trim();
    solve(str);
  }
}

function solve(str) {
  const sum = parseInt(str, 10);
  let countOne = Math.floor(sum / 3);
  let countTwo = countOne;

  const left = sum % 3;

  if (left === 1) {
    countOne++;
  }

  if (left === 2) {
    countTwo++;
  }

  console.log(`${countOne} ${countTwo}`);
}

const readline = require("readline");
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false,
});

let c = 0;

const calc = (a, b) => {
  return a + 2 * b;
};

rl.on("line", (d) => {
  if (c === 0) {
    c++;
    return;
  }

  const n = Number(d);
  const mid = Math.floor(n / 3);
  let c1 = mid;
  let c2 = mid;

  if (n % 3 === 1) {
    c1++;
  }

  if (n % 3 === 2) {
    c2++;
  }

  console.log(c1, c2);

  // const mid = Number(d) / 3;
  // const min = Math.floor(mid);
  // const max = Math.ceil(mid);

  // if (calc(min, max) === Number(d)) {
  //   console.log(min, max);
  // } else {
  //   console.log(max, min);
  // }
  c++;
});

rl.on("close", () => {});

const readline = require("readline");
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false,
});

let c = 0;

const calc = (a, b) => {
  return a + 2 * b;
};

rl.on("line", (d) => {
  if (c === 0) {
    c++;
    return;
  }

  const mid = Number(d) / 3;
  const min = Math.floor(mid);
  const max = Math.ceil(mid);

  if (calc(min, max) === Number(d)) {
    console.log(min, max);
  } else {
    console.log(max, min);
  }
  c++;
});

rl.on("close", () => {});

// Common Template Starts //
process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = ""
let currentLine = 0

process.stdin.on("data", inputStdin => inputString += inputStdin)

process.stdin.on("end", (_) => {
    inputString = inputString.trim().split("\n").map((string) => string.trim())
    main()
})

const readline = () => inputString[currentLine++]
// Common Template Ends //

// Driver Function Starts //
const main = () => {
    console.clear()
    let t = parseInt(readline())
    while (t--) {
        let n = parseInt(readline())
        // let a = readline().split(' ').map(Number)
        console.log(solve(n))
    }
}
// Driver Function Ends //

// MAIN LOGIC
const solve = (n) => {
    if ( n == 1 ) return '1 0'
    if ( n == 2 ) return '0 1'
    if ( n == 3 ) return '1 1'
    if ( n == 4 ) return '2 1'
    if ( n == 5 ) return '1 2'

    let twos1 = Math.floor( n / 3 )
    let ones1 = n - (twos1 * 2)
    let diff1 = Math.abs( ones1 - twos1 )

    let twos2 = Math.ceil( n / 3 )
    let ones2 = n - (twos2 * 2)
    let diff2 = Math.abs( ones2 - twos2 )

    return ( diff1 < diff2 ) ? ones1 + ' ' + twos1 : ones2 + ' ' + twos2
}

const isOdd = (x) => { return x & 1 }
const isEven = (x) => { return !(x & 1) }
const minOfArray   = (arr) => Math.min.apply(null, arr)
const maxOfArray   = (arr) => Math.max.apply(null, arr)
const uniqueArray  = (arr) => [...new Set(arr)]
const sortArray    = (arr) => arr.sort((a, b) => a - b)
const sumOfArray   = (arr) => arr.reduce((partialSum, a) => partialSum + a, 0)

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
    var n = lines[0];
    for(j = 1; j <= n; j++){
        var k = lines[j];
        var a = Math.floor(k / 3);
        var b = Math.floor(k / 3);
         if(k % 3 == 1){
            a++;
        }else if(k % 3 == 2){
            b++;
        }
        console.log(a + ' ' + b);
    }
});

'use strict';

// let env_local = true;
let env_local = false;
let inputString = '';
let currentLine = 0;

if (!env_local) {
  process.stdin.resume();
  process.stdin.setEncoding('utf-8');

  process.stdin.on('data', (inputStdin) => {
    inputString += inputStdin;
  });

  process.stdin.on('end', (_) => {
    inputString = inputString
      .trim()
      .split('\n')
      .map((string) => {
        return string.trim();
      });

    main();
  });
} else {
  const fs = require('fs');
  inputString = fs
    .readFileSync(__dirname + '/input.txt', 'utf-8')
    .split('\n')
    .map((string) => {
      return string.trim();
    });
  main();
}

function readline() {
  return inputString[currentLine++];
}

/*--------------------------------Play-ground---------------------------------------*/

var maxN = 2 * 1e5 + 10;

var mod = BigInt(1e9 + 7);

function solve() {
  let n = parseInt(readline());
  let c1 = 0,
    c2 = 0;
  let y = parseInt(n / 3);
  c1 += y;
  c2 += y;
  let x = n % 3;

  if (x == 2) c2++;
  else if (x == 1) c1++;
  console.log(`${c1} ${c2}`);
}

function main() {
  let t = parseInt(readline()) || 1;
  while (t--) {
    solve();
  }
}

// var n = Number(readline());

// for (var i = 1; i <= n; i++) {
//     var m = Number(readline());
//     var a = parseInt(Math.round(m / 3));
//     var b = parseInt(Math.round(m - (a * 2)));
//     console.log(b + " " + a);
// }

"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
    console.log(x);
}
let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
    inputString += inputStdin;
});
process.stdin.on("end", () => {
    inputString = inputString.split("\n");
    main();
});

function readline() {
    return inputString[currentLine++];
}

// ************************ Code Start ***************************

function main() {

    var n = Number(readline());

    for (var i = 1; i <= n; i++) {
        var m = Number(readline());
        var a = parseInt(Math.round(m / 3));
        var b = parseInt(Math.round(m - (a * 2)));
        console.log(b + " " + a);
    }

}

///////////////////////////////// pre-define ////////////////////////////////////////////////////////////////////////////////
const pr = console.log;
const assert = (condition) => { if (!condition) throw new Error("Assertion failed"); }
const mi = Math.min;
const mx = Math.max;
const mxll = (...args) => args.reduce((m, e) => e > m ? e : m);
const mill = (...args) => args.reduce((m, e) => e < m ? e : m);
const sqll = (v) => { if (v < 0n) throw 'negative input'; if (v < 2n) return v; const dfs = (n, x0) => { let x1 = ((n / x0) + x0) >> 1n; if (x0 === x1 || x0 === (x1 - 1n)) return x0; return dfs(n, x1); }; return dfs(v, 1n); }; // has >> 0
const abs = Math.abs;
const fl = Math.floor;
const int = parseInt;
const ce = Math.ceil;
const sq = Math.sqrt;
const lge = Math.log;
const lg2 = Math.log2;
const lg10 = Math.log10;
const ll = BigInt;
const combination = (m, n) => { return factorial(m, n) / factorial(n, n); };
const factorial = (m, n) => { let num = 1n; let cnt = 0; for (let i = ll(m); i > 0; i--) { if (cnt == n) break; num *= i; cnt++; } return num; };
const gcd = (a, b) => b == 0 ? a : gcd(b, a % b);
const lcm = (a, b) => (a / gcd(a, b)) * b;
const bitCount = (n) => { n = n - ((n >> 1) & 0x55555555); n = (n & 0x33333333) + ((n >> 2) & 0x33333333); return ((n + (n >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; };
const powmod = (a, b, mod) => { let r = 1n; while (b > 0n) { if (b % 2n == 1) r = r * a % mod; b >>= 1n; a = a * a % mod; } return r; };
const amax = (a) => mx.apply(Math, a);
const amin = (a) => mi.apply(Math, a);
const sm = (a) => a.reduce(((x, y) => x + y), 0);
const aeq = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
const swap = (a, i, j) => [a[i], a[j]] = [a[j], a[i]];
const stin = (a) => a.sort((x, y) => x - y);
const stde = (a) => a.sort((x, y) => y - x);
const sortPart = (a, k) => { let l = a.slice(0, k); l.sort((x, y) => x - y); let r = a.slice(k); return l.concat(r); }; // sort first kth
const initialize2DArrayNew = (n, m) => { let data = []; for (let i = 0; i < n; i++) { let tmp = Array(m).fill(0); data.push(tmp); } return data; };
const initialize3DArray = (n, m, p) => { let res = []; for (let i = 0; i < n; i++) { let data = []; for (let j = 0; j < m; j++) { let tmp = new Array(p).fill(0); data.push(tmp); } res.push(data); } return res; };
const stmkey_in = (m) => new Map([...m].sort((x, y) => x[0] - y[0]));
const stmkey_de = (m) => new Map([...m].sort((x, y) => y[0] - x[0]));
const stmvalue_in = (m) => new Map([...m].sort((x, y) => x[1] - y[1]));
const stmvalue_de = (m) => new Map([...m].sort((x, y) => y[1] - x[1]));
const counter = (a_or_s) => { let map = new Map(); for (const i of a_or_s) map.set(i, map.get(i) + 1 || 1); return map; };
const counter_value_in_indexA_in = (a_or_s) => { let m = new Map(); let n = a_or_s.length; for (let i = 0; i < n; i++) { if (!m.has(a_or_s[i])) m.set(a_or_s[i], []); m.get(a_or_s[i]).push(i); } return m; };
const counter_value_in_indexA_de = (a_or_s) => { let m = new Map(); let n = a_or_s.length; for (let i = 0; i < n; i++) { if (!m.has(a_or_s[i])) m.set(a_or_s[i], []); m.get(a_or_s[i]).unshift(i); } return m; };
const reverse2 = (s) => { let res = ""; for (let i = s.length - 1; i >= 0; i--) { res += s[i]; } return res; };
const isPalindrome = (s) => { let n = s.length; let i = 0; let j = n - 1; while (i < j) { if (s[i++] != s[j--]) return false; } return true; };
const ups = (s, i, c) => s.slice(0, i) + c + s.slice(i + 1);
const isSubsequence = (s, t) => { let sn = s.length; let tn = t.length; let i = j = 0; while (i < sn && j < tn) { if (s[i] == t[j]) { i++; j++; } else { i++; } } return j == tn; };
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 * 07/23/21 morning
 * https://codeforces.com/contest/1551/problem/A
 */
const solve = (x) => {
    let a = int(x / 3);
    let b = ce (x / 3);
    if (a + 2 * b != x) return pr(b, a);
    pr(a, b)
};

const main = () => {
    const readline = require('readline');
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });
    let input = [];
    rl.on('line', (line) => {
        input.push(Number(line));
    });
    rl.on('close', () => {
        let t = input[0];
        let i = 1;
        while (t--) {
            solve(input[i]);
            i++;
        }
    });
};

main()

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function main() {
    let t = parseInt(readLine());
    while (t-- > 0) {
        solve();
    }
}

function solve() {
    let input = readLine();
    // console.log("inputNo", inputNo);

    var c1 = Math.floor(input / 3);
    var c2 = c1;
    var rem = input % 3;

    // console.log("rem",rem)

    if (rem == 2) {
        c2++;
    }
    else if (rem == 1) {
        c1++;
    }
    console.log(c1 + " " + c2)

}

let data = '';
process.stdin.on('data', c => data += c);

function* nextLine() {
	let lines = data.trim().split(/\n/g);
	for(let l of lines){
		yield l.trim();
	}
}

let nl = nextLine();

nl.elem = function(funParse) {
		return funParse(this.next().value);
	};

nl.array = function(funParse) {
		return this.next().value.split(/\s/g).map(funParse||(x => x));
	};

nl.num = function() {
		return nl.elem(Number);
	};

nl.nums = function() {
		return nl.array(Number);
	};

nl.line = function() {
		return this.next().value;
	};

const sol = () => {
	//your code this
	let t = nl.num();
	let ans = [];
	for(let i = 0; i < t; i++){
		let x = nl.num();
		let c = Math.trunc(x / 3);
		ans.push([c + (x%3 == 1?1:0), c + (x%3 == 2?1:0)]);
	}
	console.log(ans.map(e => e.join(' ')).join('\n'));
};

process.stdin.on('end', sol);

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
    var n = lines[0];
    for(var j = 1; j <= n; j++){
        var k = lines[j];
        var a = Math.floor(k / 3);
        var b = Math.floor(k / 3);
        if(k % 3 == 1){
            a++;
        }else if(k % 3 == 2){
            b++;
        }
        console.log(a + ' ' + b);
    }
});

var dataitr;
var stdin_input = "";
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function (input) { stdin_input += input; });
process.stdin.on("end", function () { dataitr = stdin_input.split('\n').values(); main(); });

const rl = () => dataitr.next().value.trim();
const rn = () => Number(rl());
const ra = () => rl().split(' ');
const rna = () => ra().map(x => Number(x));

function main () {
	let T = rn();
	while (T--) {
		const n = rna();

		let c1 = Math.floor(n/3);
		let c2 = c1;

		c1 += n%3 == 1;
		c2 += n%3 == 2;

		console.log(c1, c2);
	}
}

/**
 * Bismillahir Rahmanir Rahim
 * This code has been taken from: https://codeforces.com/blog/entry/69610
 */
 process.stdin.resume();
 process.stdin.setEncoding('utf-8');

 let inputString = '';
 let currentLine = 0;

 process.stdin.on('data', inputStdin => {
     inputString += inputStdin;
 });

 process.stdin.on('end', _ => {
     inputString = inputString.trim().split('\n').map(string => {
         return string.trim();
     });

     main();
 });

 function readLine() {
     return inputString[currentLine++];
 }

 /****** BELOW HERE START WRITING YOUR CODE IN main() FUNCTION   ***************************************/
 /**
  * Use "readLine()" function for input, which will return a string consisting the entire line, so accordingly split the string
  * when required.
  *
  * I am using console.log() to output
  */
//  function main() {
//      let t = readLine();
//      t = parseInt(t);
//      console.log("mai yahan aaya")
//      while(t--) {
//          let line = readLine();
//          line = line.split(" ");
//          let n = parseInt(line[0]);
//          let m = parseInt(line[1]);
//          if(n === 1) {
//              console.log("0");
//          } else if (n === 2) {
//              console.log(m);
//          } else {
//              console.log(2*m);
//          }
//      }
//  }

function main() {

	let t = parseInt(readLine());
	// t = parseInt(t);
	while(t--) {
		let n = readLine();
		n = parseInt(n);
		//let s = readLine().split(" ").map(item=>parseInt(item));
		solve(n);

	}
    // console.log(t);
}

function solve(n) {
	let c = parseInt(n / 3) ;
	if (n % 3 == 0) {
		console.log(c, c);
	} else if (n % 3 == 1) {
		console.log(c+1, c);
	} else {
		console.log(c, c+1);
	}
}

'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let input = '';
process.stdin.on('data', inputStdin => {
    input += inputStdin;
});
process.stdin.on('end', _ => {
    main(input);
});
// Make a Snippet for the code above this and then write your logic in main();

function main(input) {
    const args = input.split('\n');
    const t = parseInt(args[0], 10)
    for (var i = 1; i <= t; i++) {
        const c = parseInt(args[i], 10);
        const c3 = Math.floor(c / 3);
        if (c % 3 === 0) {
            console.log(c3, c3);
        } else if (c % 3 === 1) {
            console.log(c3 + 1, c3);
        } else {
            console.log(c3, c3 + 1);
        }
    }
}

process.stdin.resume();

process.stdin.setEncoding('utf8');

var input = '';

process.stdin.on('data' , data=>{
    input += data;
});
process.stdin.on('end' , ()=>{
    main(input);
});

function main(input) {
    input = input.split("\n");
    let z = 0;
    let testCases = +input[z++];

    while(testCases--){
        let number = +input[z++];
        let count1 = Math.floor(number / 3)
        let count2 = count1;

        if(number % 3 === 1) count1++;
        else if(number % 3 === 2) count2++;
        console.log(count1, count2);
    }
}

const fs = require('fs');

const input = String(fs.readFileSync(0))
  .split('\n')
  .filter(Boolean)
  .map((str) => str.trim());

for (let i = 1; i < input.length; i += 1) {
  const n = input[i];
  console.log(solve(parseInt(n)));
}

function solve(n) {
  let c1 = Math.floor(n / 3);
  let c2 = Math.floor(n / 3);

  while (c1 + 2 * c2 <= n) {
    if (c1 + 2 * c2 === n) {
      return `${c1} ${c2}`;
    }

    if (c1 + 1 + 2 * c2 === n) {
      return `${c1 + 1} ${c2}`;
    }

    if (c1 + 2 * (c2 + 1) === n) {
      return `${c1} ${c2 + 1}`;
    }

    c1 += 1;
    c2 += 1;
  }

  return 'error after';
}

let i = ''
let lines;
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    lines = i.split('\n'); // your input text, split by lines
    main();
});

function main() {
    let t = parseInt(lines.shift());

    while (t > 0) {
        const n = parseInt(lines.shift());
        let c1 = Math.floor(n / 3);
        let c2 = Math.floor(n / 3);
        switch (n % 3) {
            case 1:
                c1++;
                break;
            case 2:
                c2++;
                break;
        }
        console.log(c1, c2);
        t--;
    }
}

var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
var lines = [];
rl.on('line', function(input) {
    lines.push(input);
});
rl.on('close', function() {
    var l = 0;
    var t = +lines[l++]
    for (var i = 0; i < t; i++) {
        var a = +lines[l++]
        console.log(solve(a))
    }
});

function solve(n) {
    const k = Math.floor(n / 3)
    const r = n % 3
    let a = k
    let b = k
    if (r === 1) {
        a++
    } else if (r === 2) {
        b++
    }
    return [a, b].join(' ')
}

function polycarp(input) {
    var c1 = Math.floor(input / 3);
    var c2 = c1;
    var rem = input % 3;
    if (rem == 2) c2++;
    else if (rem == 1) c1++;
    return `${c1} ${c2}`;
}

var n = parseInt(readline());
for (var i = 0; i < n; i++) {
    var input = readline();
    print(polycarp(input));
}

function polycarp(input) {
    var c1 = Math.floor(input / 3);
    var c2 = c1;
    var rem = input % 3;
    if (rem == 2) c2++;
    else if (rem == 1) c1++;
    return `${c1} ${c2}`;
}

var n = parseInt(readline());
for (var i = 0; i < n; i++) {
    var input = +readline();
    print(polycarp(input));
}

function polycarp(input) {
    var c1 = Math.floor(input / 3);
    var c2 = c1;
    var rem = input % 3;
    if (rem == 2) c2++;
    else if (rem == 1) c1++;
    return c1 + ' ' + c2; // `${c1} ${c2}`;
}

var n = parseInt(readline());
for (var i = 0; i < n; i++) {
    var input = +readline();
    print(polycarp(input));
}

// var input = readline();
// for(var i = 0; i < input; i ++) {
//     var num = +readline();
//     var c1 = c2 = Math.floor(num / 3);
//     if(num % 3 > 0) num % 3 === 1 ? c1 ++ : c2 ++;
//     print(c1 + ' ' + c2)
// }

var input = readline();
for(var i = 0; i < input; i ++) {
    var num = +readline();
    var c1 = c2 = Math.floor(num / 3);
    if(num % 3 > 0) num % 3 === 1 ? c1 ++ : c2 ++;
    print(`${c1} ${c2}`)
}

var input = readline();
for(var i = 0; i < input; i ++) {
    var num = +readline();
    var c1 = c2 = Math.floor(num / 3);
    if(num % 3 > 0) num % 3 === 1 ? c1 ++ : c2 ++;
    print(c1 + ' ' + c2)
}

var input = readline();
for(var i = 0; i < input; i ++) {
    var num = parseInt(readline());
    var c1 = c2 = Math.floor(num / 3);
    if(num % 3 > 0) num % 3 === 1 ? c1 ++ : c2 ++;
    print(c1 + ' ' + c2)
}

var input = readline();
for(var i = 0; i < input; i ++) {
    var num = readline();
    var c1 = c2 = Math.floor(num / 3);
    if(num % 3 > 0) num % 3 === 1 ? c1 ++ : c2 ++;
    print(c1 + ' ' + c2)
}

function jobs(n)
{
        c1 = Math.floor(n/3);
        if (n%3!=0) {checking = (((n/3)-c1)+'').split ('.') [1][0];}
        else {c2 = Math.round((n-c1)/2);return `${c1} ${c2}`;}
    if (checking>5)
    {

        c2 = Math.round((n-c1)/2);
    }
    else
    {
        c1++;
        c2 = Math.round((n-c1)/2);
    }
    return `${c1} ${c2}`;
//console.log(c1, c2);

    }
    t = parseInt(readline())
    for (i=0;i<t;i++){
        print(jobs(parseInt(readline())));

    }

function jobs()
{
    t = parseInt(readline())
    for (i=0;i<t;i++)
    {
        n = parseInt(readline())
        c1 = Math.floor(n/3);
        if (n%3!=0) {checking = (((n/3)-c1)+'').split ('.') [1][0];}
        else {c2 = Math.round((n-c1)/2);print(c1, c2);continue}

    if (checking>5)
    {

        c2 = Math.round((n-c1)/2);
    }
    else if (checking==0) {c2=Math.round((n-c1)/2)}
    else
    {
        c1++;
        c2 = Math.round((n-c1)/2);
    }

print(c1, c2);
    }

}

jobs()

var x = readline();
while (x--) {
  var n = readline();
  var b = Math.round(n / 3);
  var a = n - 2 * b;
  print(a + " " + b);
}

var t = readline();
while(t--)
{
    var n=readline();
    var c=Math.round(n/3);
    if(c*3==n)
    {
        print(c, c);
    }
    else if(n-3*c==1)
    {
        print(c+1, c);
    }
    else
    {
        print(c-1, c);
    }
}

var t = readline();
while(t--)
{
    var n=readline();
    var c=Math.round(n/3);
    var p=c+1;
    var z=c-1;
    if(c*3==n)
    {
        print(c+" "+c);
    }
    else if(n-3*c==1)
    {
        print(p+" "+c);
    }
    else
    {
        print(z+" "+c);
    }
}

s = readline(); while(s--){n = readline(); b = Math.round(n / 3); a = n - 2*b; print(a + " " + b);}

function polycarpAndCoins(coins) {
  var a1 = Math.floor(coins / 3);
  var a2 = coins % 3;
  if(a2 === 2) {
    return a1 + " " + (a1 + 1);
  }
  if(a2 === 1) {
    return (a1 + 1) + " " + a1;
  }
  return a1 + " " + a1;
}

const readNumber = () => +readline();

const n = readNumber();
for(var i = 0; i < n; i++) {
  print(polycarpAndCoins(readNumber()));
}

const readNumber = () => +readline();

const n = readNumber();

for(var i = 0; i < n; i++) {
  var v = readNumber();
  var a1 = Math.floor(v / 3);
  var a2 = v % 3;
  if(a2 === 2) {
    print(a1 + " " + (a1 + 1));
    continue;
  }
  if(a2 === 1) {
    print((a1 + 1) + " " + a1);
    continue;
  }
  print(a1 + " " + a1);
}

var cases = parseInt(readline());
    print();
    while(cases--){
        var target=parseInt(readline());
        var c2=parseInt(target/3);
        var c1=target-(c2*2);
        if(c1-c2==2){
            c1-=2;
            c2++;
        }
        print(c1+" "+c2);
    }

main(parseInt(readline()));
function main(cases) {
    print();
    while(cases--){
        var target=parseInt(readline());
        var c2=parseInt(target/3);
        var c1=target-(c2*2);
        if(c1-c2==2){
            c1-=2;
            c2++;
        }
        print(c1+" "+c2);
    }
}

function solve()
{
	var a = +readline();
	var z = Math.floor(a / 3);
	if(a % 3 === 0 )
	print(z + " "+ z);
	else if(a % 3 === 2 ) print ((z) + " "+ (z+1))
	else print((z+1) + " "+ (z))
}

	var  n = +readline();
	for (var i = 0; i < n; i++)
			solve();

var limit = parseInt(readline());
    for (var i = 0; i < limit; i++) {
        var value = parseInt(readline());
        var coins = Math.floor(value / 3);
        var ones = coins;
        var twos = coins;
        if (value % 3 !== 0) {
            if (value % 3 === 1)
                ones++;
            else
                twos++;
        }
        print("".concat(ones, " ").concat(twos));
    }

test = readline()
while (test--) {
    burles = readline();
    x = Math.round(burles / 3)
    y = burles - 2 * x;
    print(y,x)
}

var nm=readline()
while(nm--){
    var n=parseInt(readline())
    var t=parseInt(n/3)
    if(n%3!==2) print(n-(2*t)+ ' '+t)
    else{
        print(parseInt(n/3)+' '+(n-parseInt(n/3))/2)
    }
}

var t = Number(readline());

while (t--) {
    var buries = Number(readline());
    var b = buries / 3;

    if (buries % 3 == 0)
        print(b + " " + b);

    else {
        if (Math.floor(b) * 3 + 1 == buries)
            print(Math.floor(b) + 1 + " " + Math.floor(b));
        else
            print(Math.floor(b) + " " + (Math.floor(b) + 1));
    }
}

var numberOfCases = Number(readline());
for (var i = 0; i < numberOfCases; ++i) {
    processCase();
}

function processCase() {
    var n = Number(readline());

    var c1 = c2 = Math.floor(n / 3);
    if (n % 3 === 1) {
        ++c1;
    }

    if (n % 3 === 2) {
        ++c2;
    }

    print(`${c1} ${c2}`);
}

var testCases = +readline();

while (testCases-- > 0) {
    var n = +readline();

    var n3 = Math.floor(n / 3);
    switch (n % 3) {
        case 0:
            print(n3, n3);
            break;
        case 1:
            print(n3 + 1, n3);
            break;
        case 2:
            print(n3, n3 + 1)
            break;
    }
}

var l0 = readline();
var n = +l0;
var arr = [];
for (var a = 0; a<n; a++) {
    arr.push(+readline());
}

// 1 burles
// 2 burles
var one = 0;
var two = 0;
var sum = 0;
for (var x = 0; x<arr.length; x++) {
    var temp = Math.floor(arr[x]/3);
    var one = temp;
    var two = temp;
    if (arr[x]%3===2) two++;
    if (arr[x]%3===1) one++;
    print(one, two);
}

"use strict";

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let _inputString = '';
let _currentLine = 0;

process.stdin.on('data', inputStdin => {
    _inputString += inputStdin;
});

process.stdin.on('end', _ => {
    _inputString = _inputString.trim().split('\n').map(string => string.trim());
    main();
});

const readLine = () => _inputString[_currentLine++];

const nextIntArray = () => readLine.split(" ").map(x => parseInt(x));
const nextFloatArray = () => readLine.split(" ").map(x => parseFloat(x));
const nextInt = () => parseInt(readLine());

const gcd = (a, b) => a ? gcd(b % a, a) : b;
const lcm = (a, b) => a * b / gcd(a, b);

function print(...args) {
    console.log(...args);
}

function solve() {
    let n = nextInt();
    let a = Math.floor(n / 3);
    let m = n % 3;
    let b = a + m;
    let c = a + 2;
    let d = b - 1;
    if (Math.abs(a - b) <= Math.abs(c - d)) {
        print(a, b);
    } else {
        print(c, d);
    }
}

function main() {
    let testCases = 1;
    testCases = parseInt(readLine());
    for (let i = 0; i < testCases; i++) {
        solve();
    }
}

"use strict";

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let _inputString = '';
let _currentLine = 0;

process.stdin.on('data', inputStdin => {
    _inputString += inputStdin;
});

process.stdin.on('end', _ => {
    _inputString = _inputString.trim().split('\n').map(string => string.trim());
    main();
});

const readLine = () => _inputString[_currentLine++];

const nextIntArray = () => readLine.split(" ").map(x => parseInt(x));
const nextFloatArray = () => readLine.split(" ").map(x => parseFloat(x));
const nextInt = () => parseInt(readLine());

const gcd = (a, b) => a ? gcd(b % a, a) : b;
const lcm = (a, b) => a * b / gcd(a, b);

function print(...args) {
    console.log(...args);
}

function solve() {
    let n = nextInt();
    let a = n / 3;
    let m = n % 3;
    let b = a + m;
    let c = a + 2;
    let d = b - 1;
    if (Math.abs(a - b) <= Math.abs(c - d)) {
        print(a, b);
    } else {
        print(c, d);
    }
}

function main() {
    let testCases = 1;
    testCases = parseInt(readLine());
    for (let i = 0; i < testCases; i++) {
        solve();
    }
}

"use strict";

const fs = require("fs");

const _access = fs.createReadStream("input.txt");
process.stdin.read = _access.read.bind(_access);

let local = true;
process.on("uncaughtException", err => {
    local = false;
});

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let _inputString = '';
let _currentLine = 0;

process.stdin.on('data', inputStdin => {
    _inputString += inputStdin;
});

process.stdin.on('end', _ => {
    _inputString = _inputString.trim().split('\n').map(string => string.trim());
    main();
});

const readLine = () => _inputString[_currentLine++];

const nextIntArray = () => readLine.split(" ").map(x => parseInt(x));
const nextFloatArray = () => readLine.split(" ").map(x => parseFloat(x));
const nextInt = () => parseInt(readLine());

const gcd = (a, b) => a ? gcd(b % a, a) : b;
const lcm = (a, b) => a * b / gcd(a, b);

function print(...args) {
    console.log(...args);
}

function solve() {
    let n = nextInt();
    let a = n / 3;
    let m = n % 3;
    let b = a + m;
    let c = a + 2;
    let d = b - 1;
    if (Math.abs(a - b) <= Math.abs(c - d)) {
        print(a, b);
    } else {
        print(c, d);
    }
}

function main() {
    let testCases = 1;
    testCases = parseInt(readLine());
    for (let i = 0; i < testCases; i++) {
        solve();
    }
}

process.stdin.resume();

process.stdin.setEncoding('utf8');

var input = '';

process.stdin.on('data' , data=>{
    input += data;
});
process.stdin.on('end' , ()=>{
    main(input);
});

function main(input) {
    input = input.split("\n");
    let z = 0;
    let testCases = parseInt(input[z++], 10);

    while(testCases--){
        let str = input[z++].trim().split('');
        solve(str)
    }
}

function solve(str){
  const sum = parseInt(str, 10);
  let count = Math.floor(sum / 3);

  const left = sum % 3

  if(left === 0){
    console.log(`${count} ${count}`);
  } else if(left === 1){
    console.log(`${count++} ${count}`);
  } else {
    console.log(`${count} ${count++}`);
  }

}

process.stdin.resume();

process.stdin.setEncoding('utf8');

var input = '';

process.stdin.on('data' , data=>{
    input += data;
});
process.stdin.on('end' , ()=>{
    main(input);
});

function main(input) {
    input = input.split("\n");
    let z = 0;
    let testCases = Number(input[z++]);

    while(testCases--){
        let str = input[z++].trim().split('');
        solve(str)
    }
}

function solve(str){
  const sum = Number(str);
  let count = Math.floor(sum);

  const left = sum % 3

  if(left === 0){
    console.log(`${count} ${count}`);
  } else if(left === 1){
    console.log(`${count++} ${count}`);
  } else {
    console.log(`${count} ${count++}`);
  }

}

// Common Template Starts //
process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = ""
let currentLine = 0

process.stdin.on("data", inputStdin => inputString += inputStdin)

process.stdin.on("end", (_) => {
    inputString = inputString.trim().split("\n").map((string) => string.trim())
    main()
})

const readline = () => inputString[currentLine++]
// Common Template Ends //

// Driver Function Starts //
const main = () => {
    console.clear()
    let t = parseInt(readline())
    while (t--) {
        let n = parseInt(readline())
        // let a = readline().split(' ').map(Number)
        console.log(solve(n))
    }
}
// Driver Function Ends //

// MAIN LOGIC
const solve = (n) => {
    if ( n == 1 ) return '1 0'
    if ( n == 2 ) return '0 1'
    if ( n == 3 ) return '1 1'
    if ( n == 4 ) return '2 1'
    if ( n == 5 ) return '1 2'

    let twos1 = Math.floor( n / 3 )
    let ones1 = n - (twos1 * 2)
    let diff1 = Math.abs( ones1 - twos1 )

    let twos2 = Math.ceil( n / 3 )
    let ones2 = n - (twos2 * 2)
    let diff2 = Math.abs( ones2 - twos2 )

    return ( diff1 < diff2 ) ? twos1 + ' ' + ones1 : twos2 + ' ' + ones2
}

const isOdd = (x) => { return x & 1 }
const isEven = (x) => { return !(x & 1) }
const minOfArray   = (arr) => Math.min.apply(null, arr)
const maxOfArray   = (arr) => Math.max.apply(null, arr)
const uniqueArray  = (arr) => [...new Set(arr)]
const sortArray    = (arr) => arr.sort((a, b) => a - b)
const sumOfArray   = (arr) => arr.reduce((partialSum, a) => partialSum + a, 0)

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const lines = i.split(EOL);
    var n = lines[0];
    for(j = 1; j <= n; j++){
        var k = lines[j];
        var a = Math.floor(k / 3);
        var b = Math.floor(k / 3);
        console.log(a + ' ' + b);
    }
});

'use strict';

// let env_local = true;
let env_local = false;
let inputString = '';
let currentLine = 0;

if (!env_local) {
  process.stdin.resume();
  process.stdin.setEncoding('utf-8');

  process.stdin.on('data', (inputStdin) => {
    inputString += inputStdin;
  });

  process.stdin.on('end', (_) => {
    inputString = inputString
      .trim()
      .split('\n')
      .map((string) => {
        return string.trim();
      });

    main();
  });
} else {
  const fs = require('fs');
  inputString = fs
    .readFileSync(__dirname + '/input.txt', 'utf-8')
    .split('\n')
    .map((string) => {
      return string.trim();
    });
  main();
}

function readline() {
  return inputString[currentLine++];
}

/*--------------------------------Play-ground---------------------------------------*/

var maxN = 2 * 1e5 + 10;

var mod = BigInt(1e9 + 7);

function solve() {
  let n = parseInt(readline());
  let c1 = 0,
    c2 = 0;
  let y = parseInt(n / 3);
  c1 += y;
  c2 += y;
  let x = n % 3;

  if (x == 2) c2++;
  else c1++;
  console.log(`${c1} ${c2}`);
}

function main() {
  let t = parseInt(readline()) || 1;
  while (t--) {
    solve();
  }
}

///////////////////////////////// pre-define ////////////////////////////////////////////////////////////////////////////////
const pr = console.log;
const assert = (condition) => { if (!condition) throw new Error("Assertion failed"); }
const mi = Math.min;
const mx = Math.max;
const mxll = (...args) => args.reduce((m, e) => e > m ? e : m);
const mill = (...args) => args.reduce((m, e) => e < m ? e : m);
const sqll = (v) => { if (v < 0n) throw 'negative input'; if (v < 2n) return v; const dfs = (n, x0) => { let x1 = ((n / x0) + x0) >> 1n; if (x0 === x1 || x0 === (x1 - 1n)) return x0; return dfs(n, x1); }; return dfs(v, 1n); }; // has >> 0
const abs = Math.abs;
const fl = Math.floor;
const int = parseInt;
const ce = Math.ceil;
const sq = Math.sqrt;
const lge = Math.log;
const lg2 = Math.log2;
const lg10 = Math.log10;
const ll = BigInt;
const combination = (m, n) => { return factorial(m, n) / factorial(n, n); };
const factorial = (m, n) => { let num = 1n; let cnt = 0; for (let i = ll(m); i > 0; i--) { if (cnt == n) break; num *= i; cnt++; } return num; };
const gcd = (a, b) => b == 0 ? a : gcd(b, a % b);
const lcm = (a, b) => (a / gcd(a, b)) * b;
const bitCount = (n) => { n = n - ((n >> 1) & 0x55555555); n = (n & 0x33333333) + ((n >> 2) & 0x33333333); return ((n + (n >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; };
const powmod = (a, b, mod) => { let r = 1n; while (b > 0n) { if (b % 2n == 1) r = r * a % mod; b >>= 1n; a = a * a % mod; } return r; };
const amax = (a) => mx.apply(Math, a);
const amin = (a) => mi.apply(Math, a);
const sm = (a) => a.reduce(((x, y) => x + y), 0);
const aeq = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
const swap = (a, i, j) => [a[i], a[j]] = [a[j], a[i]];
const stin = (a) => a.sort((x, y) => x - y);
const stde = (a) => a.sort((x, y) => y - x);
const sortPart = (a, k) => { let l = a.slice(0, k); l.sort((x, y) => x - y); let r = a.slice(k); return l.concat(r); }; // sort first kth
const initialize2DArrayNew = (n, m) => { let data = []; for (let i = 0; i < n; i++) { let tmp = Array(m).fill(0); data.push(tmp); } return data; };
const initialize3DArray = (n, m, p) => { let res = []; for (let i = 0; i < n; i++) { let data = []; for (let j = 0; j < m; j++) { let tmp = new Array(p).fill(0); data.push(tmp); } res.push(data); } return res; };
const stmkey_in = (m) => new Map([...m].sort((x, y) => x[0] - y[0]));
const stmkey_de = (m) => new Map([...m].sort((x, y) => y[0] - x[0]));
const stmvalue_in = (m) => new Map([...m].sort((x, y) => x[1] - y[1]));
const stmvalue_de = (m) => new Map([...m].sort((x, y) => y[1] - x[1]));
const counter = (a_or_s) => { let map = new Map(); for (const i of a_or_s) map.set(i, map.get(i) + 1 || 1); return map; };
const counter_value_in_indexA_in = (a_or_s) => { let m = new Map(); let n = a_or_s.length; for (let i = 0; i < n; i++) { if (!m.has(a_or_s[i])) m.set(a_or_s[i], []); m.get(a_or_s[i]).push(i); } return m; };
const counter_value_in_indexA_de = (a_or_s) => { let m = new Map(); let n = a_or_s.length; for (let i = 0; i < n; i++) { if (!m.has(a_or_s[i])) m.set(a_or_s[i], []); m.get(a_or_s[i]).unshift(i); } return m; };
const reverse2 = (s) => { let res = ""; for (let i = s.length - 1; i >= 0; i--) { res += s[i]; } return res; };
const isPalindrome = (s) => { let n = s.length; let i = 0; let j = n - 1; while (i < j) { if (s[i++] != s[j--]) return false; } return true; };
const ups = (s, i, c) => s.slice(0, i) + c + s.slice(i + 1);
const isSubsequence = (s, t) => { let sn = s.length; let tn = t.length; let i = j = 0; while (i < sn && j < tn) { if (s[i] == t[j]) { i++; j++; } else { i++; } } return j == tn; };
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 * 07/23/21 morning
 * https://codeforces.com/contest/1551/problem/A
 */
const solve = (x) => {
    pr(ce(x / 3), int(x / 3))
};

const main = () => {
    const readline = require('readline');
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });
    let input = [];
    rl.on('line', (line) => {
        input.push(Number(line));
    });
    rl.on('close', () => {
        let t = input[0];
        let i = 1;
        while (t--) {
            solve(input[i]);
            i++;
        }
    });
};

main()

var t = readline();
while (t--) {
  var x = readline();
  var z = Math.round(x / 3);
  if (z + ((x - x / 3) / 2) * 2 !== x) {
    z += 1;
  }

  print(z + " " + Math.round((x - x / 3) / 2));
}

var t = readline();
while (t--) {
  var x = readline();
  var z = Math.round(x / 3);
  if (z + ((x - x / 3) / 2) * 2 !== x) {
    z += 1;
  }

  print(z + " " + Number((x - x / 3) / 2));
}

var t = readline();
while (t--) {
  var x = readline();
  var z = Math.round(x / 3);
  if (z + ((x - x / 3) / 2) * 2 !== x) {
    z += 1;
  }

  print(z + " " + (x - x / 3) / 2);
}

var t = readline();
while(t--)
{
    var n=readline();
    var c=Math.round(n/3);
    var p=c+1;
    var z=c-1;
    if(c*3===n)
    {
        print(c+" "+c);
    }
    else if(n-3*c==1)
    {
        print(p+" "+c);
    }
    else
    {
        print(z+" "+c);
    }
}

function solve()
{
	var a = +readline();
	var z = Math.floor(a / 3);
	if(a % 3 === 0 )
	print(z + " "+ z);
	else print ((z+1) + " "+ z)
}

	var  n = +readline();
	for (var i = 0; i < n; i++)
			solve();