import java.util.Random;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
class Lotto{
int lotto[] = new int[6];
public void init(){
Random rd = new Random(); //클래스 생성
for(int i=0; i<6; i++){
lotto[i] = rd.nextInt(45)+1; //1~45까지의 난수 발생
for(int j=0; j<i; j++){
if(lotto[i] == lotto[j]){ //중복되는 수가 나오면 다시 돌리기
i--; break;
}//if
}//for j
} //for i
} //init
public void sort(){ //생성된 6개의 수 오름차순 정렬
for(int i=0; i<6; i++){
for(int j=0; j<i; j++){
if(lotto[j] >lotto[i]){
int temp = lotto[i];
lotto[i] = lotto[j];
lotto[j] = temp;
} //if
} //for j
} //for i
} // sort
public void disp(){
for(int i=0; i<6; i++){
System.out.print(lotto[i]+"\t");
}//for i
}//disp
public static void main(String[] args) throws IOException {
Lotto lt = new Lotto();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("몇장사시겠습니까? : ");
int su = Integer.parseInt(br.readLine());
System.out.println();
for(int i=0; i<su; i++){
lt.init();
lt.sort();
lt.disp();
System.out.println();
}
}
}