//2008 - 4

import java.util.*;

public class NextPermutation {

  public static void main(String[] args){
  
    Scanner input = new Scanner(System.in);
    Scanner inputString = new Scanner(System.in);
    int times = input.nextInt();
    
    for(int i = 0; i < times; i++){
      
      String rawIn = inputString.nextLine();
      
    }
    
  }
  
}

Create NextPermutation.java