fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. List<List<String>> lists = Arrays.asList(
  14. Arrays.asList("Quick", "Brown"),
  15. Arrays.asList("Fox", "Cat", "Dog"),
  16. Arrays.asList("Jumps", "Eats", "Sleeps"),
  17. Arrays.asList("Like", "Unlike"),
  18. Arrays.asList("a Fat", "a Crazy", "a Large"),
  19. Arrays.asList("Rat", "Walrus", "Wombat")
  20. );
  21.  
  22. iterate(lists);
  23.  
  24.  
  25. }
  26.  
  27. static void print(String a, String b, String c, String d, String e, String f) {
  28. System.out.println(a+" "+b+" "+c+" "+d+" "+e+" "+f);
  29. }
  30.  
  31. static void iterate(List<List<String>> lists) {
  32. int[] size = new int[lists.size()+1];
  33. size[lists.size()] = 1;
  34. for (int i = lists.size()-1 ; i >= 0 ; i--) {
  35. size[i] = size[i+1]*lists.get(i).size();
  36. }
  37. for (int i = 0 ; i != size[0] ; i++) {
  38. print(
  39. lists.get(0).get((i/size[1]) % lists.get(0).size())
  40. , lists.get(1).get((i/size[2]) % lists.get(1).size())
  41. , lists.get(2).get((i/size[3]) % lists.get(2).size())
  42. , lists.get(3).get((i/size[4]) % lists.get(3).size())
  43. , lists.get(4).get((i/size[5]) % lists.get(4).size())
  44. , lists.get(5).get((i/size[6]) % lists.get(5).size())
  45. );
  46. }
  47. }
  48.  
  49.  
  50.  
  51. }
Success #stdin #stdout 0.11s 29000KB
stdin
Standard input is empty
stdout
Quick Fox Jumps Like a Fat Rat
Quick Fox Jumps Like a Fat Walrus
Quick Fox Jumps Like a Fat Wombat
Quick Fox Jumps Like a Crazy Rat
Quick Fox Jumps Like a Crazy Walrus
Quick Fox Jumps Like a Crazy Wombat
Quick Fox Jumps Like a Large Rat
Quick Fox Jumps Like a Large Walrus
Quick Fox Jumps Like a Large Wombat
Quick Fox Jumps Unlike a Fat Rat
Quick Fox Jumps Unlike a Fat Walrus
Quick Fox Jumps Unlike a Fat Wombat
Quick Fox Jumps Unlike a Crazy Rat
Quick Fox Jumps Unlike a Crazy Walrus
Quick Fox Jumps Unlike a Crazy Wombat
Quick Fox Jumps Unlike a Large Rat
Quick Fox Jumps Unlike a Large Walrus
Quick Fox Jumps Unlike a Large Wombat
Quick Fox Eats Like a Fat Rat
Quick Fox Eats Like a Fat Walrus
Quick Fox Eats Like a Fat Wombat
Quick Fox Eats Like a Crazy Rat
Quick Fox Eats Like a Crazy Walrus
Quick Fox Eats Like a Crazy Wombat
Quick Fox Eats Like a Large Rat
Quick Fox Eats Like a Large Walrus
Quick Fox Eats Like a Large Wombat
Quick Fox Eats Unlike a Fat Rat
Quick Fox Eats Unlike a Fat Walrus
Quick Fox Eats Unlike a Fat Wombat
Quick Fox Eats Unlike a Crazy Rat
Quick Fox Eats Unlike a Crazy Walrus
Quick Fox Eats Unlike a Crazy Wombat
Quick Fox Eats Unlike a Large Rat
Quick Fox Eats Unlike a Large Walrus
Quick Fox Eats Unlike a Large Wombat
Quick Fox Sleeps Like a Fat Rat
Quick Fox Sleeps Like a Fat Walrus
Quick Fox Sleeps Like a Fat Wombat
Quick Fox Sleeps Like a Crazy Rat
Quick Fox Sleeps Like a Crazy Walrus
Quick Fox Sleeps Like a Crazy Wombat
Quick Fox Sleeps Like a Large Rat
Quick Fox Sleeps Like a Large Walrus
Quick Fox Sleeps Like a Large Wombat
Quick Fox Sleeps Unlike a Fat Rat
Quick Fox Sleeps Unlike a Fat Walrus
Quick Fox Sleeps Unlike a Fat Wombat
Quick Fox Sleeps Unlike a Crazy Rat
Quick Fox Sleeps Unlike a Crazy Walrus
Quick Fox Sleeps Unlike a Crazy Wombat
Quick Fox Sleeps Unlike a Large Rat
Quick Fox Sleeps Unlike a Large Walrus
Quick Fox Sleeps Unlike a Large Wombat
Quick Cat Jumps Like a Fat Rat
Quick Cat Jumps Like a Fat Walrus
Quick Cat Jumps Like a Fat Wombat
Quick Cat Jumps Like a Crazy Rat
Quick Cat Jumps Like a Crazy Walrus
Quick Cat Jumps Like a Crazy Wombat
Quick Cat Jumps Like a Large Rat
Quick Cat Jumps Like a Large Walrus
Quick Cat Jumps Like a Large Wombat
Quick Cat Jumps Unlike a Fat Rat
Quick Cat Jumps Unlike a Fat Walrus
Quick Cat Jumps Unlike a Fat Wombat
Quick Cat Jumps Unlike a Crazy Rat
Quick Cat Jumps Unlike a Crazy Walrus
Quick Cat Jumps Unlike a Crazy Wombat
Quick Cat Jumps Unlike a Large Rat
Quick Cat Jumps Unlike a Large Walrus
Quick Cat Jumps Unlike a Large Wombat
Quick Cat Eats Like a Fat Rat
Quick Cat Eats Like a Fat Walrus
Quick Cat Eats Like a Fat Wombat
Quick Cat Eats Like a Crazy Rat
Quick Cat Eats Like a Crazy Walrus
Quick Cat Eats Like a Crazy Wombat
Quick Cat Eats Like a Large Rat
Quick Cat Eats Like a Large Walrus
Quick Cat Eats Like a Large Wombat
Quick Cat Eats Unlike a Fat Rat
Quick Cat Eats Unlike a Fat Walrus
Quick Cat Eats Unlike a Fat Wombat
Quick Cat Eats Unlike a Crazy Rat
Quick Cat Eats Unlike a Crazy Walrus
Quick Cat Eats Unlike a Crazy Wombat
Quick Cat Eats Unlike a Large Rat
Quick Cat Eats Unlike a Large Walrus
Quick Cat Eats Unlike a Large Wombat
Quick Cat Sleeps Like a Fat Rat
Quick Cat Sleeps Like a Fat Walrus
Quick Cat Sleeps Like a Fat Wombat
Quick Cat Sleeps Like a Crazy Rat
Quick Cat Sleeps Like a Crazy Walrus
Quick Cat Sleeps Like a Crazy Wombat
Quick Cat Sleeps Like a Large Rat
Quick Cat Sleeps Like a Large Walrus
Quick Cat Sleeps Like a Large Wombat
Quick Cat Sleeps Unlike a Fat Rat
Quick Cat Sleeps Unlike a Fat Walrus
Quick Cat Sleeps Unlike a Fat Wombat
Quick Cat Sleeps Unlike a Crazy Rat
Quick Cat Sleeps Unlike a Crazy Walrus
Quick Cat Sleeps Unlike a Crazy Wombat
Quick Cat Sleeps Unlike a Large Rat
Quick Cat Sleeps Unlike a Large Walrus
Quick Cat Sleeps Unlike a Large Wombat
Quick Dog Jumps Like a Fat Rat
Quick Dog Jumps Like a Fat Walrus
Quick Dog Jumps Like a Fat Wombat
Quick Dog Jumps Like a Crazy Rat
Quick Dog Jumps Like a Crazy Walrus
Quick Dog Jumps Like a Crazy Wombat
Quick Dog Jumps Like a Large Rat
Quick Dog Jumps Like a Large Walrus
Quick Dog Jumps Like a Large Wombat
Quick Dog Jumps Unlike a Fat Rat
Quick Dog Jumps Unlike a Fat Walrus
Quick Dog Jumps Unlike a Fat Wombat
Quick Dog Jumps Unlike a Crazy Rat
Quick Dog Jumps Unlike a Crazy Walrus
Quick Dog Jumps Unlike a Crazy Wombat
Quick Dog Jumps Unlike a Large Rat
Quick Dog Jumps Unlike a Large Walrus
Quick Dog Jumps Unlike a Large Wombat
Quick Dog Eats Like a Fat Rat
Quick Dog Eats Like a Fat Walrus
Quick Dog Eats Like a Fat Wombat
Quick Dog Eats Like a Crazy Rat
Quick Dog Eats Like a Crazy Walrus
Quick Dog Eats Like a Crazy Wombat
Quick Dog Eats Like a Large Rat
Quick Dog Eats Like a Large Walrus
Quick Dog Eats Like a Large Wombat
Quick Dog Eats Unlike a Fat Rat
Quick Dog Eats Unlike a Fat Walrus
Quick Dog Eats Unlike a Fat Wombat
Quick Dog Eats Unlike a Crazy Rat
Quick Dog Eats Unlike a Crazy Walrus
Quick Dog Eats Unlike a Crazy Wombat
Quick Dog Eats Unlike a Large Rat
Quick Dog Eats Unlike a Large Walrus
Quick Dog Eats Unlike a Large Wombat
Quick Dog Sleeps Like a Fat Rat
Quick Dog Sleeps Like a Fat Walrus
Quick Dog Sleeps Like a Fat Wombat
Quick Dog Sleeps Like a Crazy Rat
Quick Dog Sleeps Like a Crazy Walrus
Quick Dog Sleeps Like a Crazy Wombat
Quick Dog Sleeps Like a Large Rat
Quick Dog Sleeps Like a Large Walrus
Quick Dog Sleeps Like a Large Wombat
Quick Dog Sleeps Unlike a Fat Rat
Quick Dog Sleeps Unlike a Fat Walrus
Quick Dog Sleeps Unlike a Fat Wombat
Quick Dog Sleeps Unlike a Crazy Rat
Quick Dog Sleeps Unlike a Crazy Walrus
Quick Dog Sleeps Unlike a Crazy Wombat
Quick Dog Sleeps Unlike a Large Rat
Quick Dog Sleeps Unlike a Large Walrus
Quick Dog Sleeps Unlike a Large Wombat
Brown Fox Jumps Like a Fat Rat
Brown Fox Jumps Like a Fat Walrus
Brown Fox Jumps Like a Fat Wombat
Brown Fox Jumps Like a Crazy Rat
Brown Fox Jumps Like a Crazy Walrus
Brown Fox Jumps Like a Crazy Wombat
Brown Fox Jumps Like a Large Rat
Brown Fox Jumps Like a Large Walrus
Brown Fox Jumps Like a Large Wombat
Brown Fox Jumps Unlike a Fat Rat
Brown Fox Jumps Unlike a Fat Walrus
Brown Fox Jumps Unlike a Fat Wombat
Brown Fox Jumps Unlike a Crazy Rat
Brown Fox Jumps Unlike a Crazy Walrus
Brown Fox Jumps Unlike a Crazy Wombat
Brown Fox Jumps Unlike a Large Rat
Brown Fox Jumps Unlike a Large Walrus
Brown Fox Jumps Unlike a Large Wombat
Brown Fox Eats Like a Fat Rat
Brown Fox Eats Like a Fat Walrus
Brown Fox Eats Like a Fat Wombat
Brown Fox Eats Like a Crazy Rat
Brown Fox Eats Like a Crazy Walrus
Brown Fox Eats Like a Crazy Wombat
Brown Fox Eats Like a Large Rat
Brown Fox Eats Like a Large Walrus
Brown Fox Eats Like a Large Wombat
Brown Fox Eats Unlike a Fat Rat
Brown Fox Eats Unlike a Fat Walrus
Brown Fox Eats Unlike a Fat Wombat
Brown Fox Eats Unlike a Crazy Rat
Brown Fox Eats Unlike a Crazy Walrus
Brown Fox Eats Unlike a Crazy Wombat
Brown Fox Eats Unlike a Large Rat
Brown Fox Eats Unlike a Large Walrus
Brown Fox Eats Unlike a Large Wombat
Brown Fox Sleeps Like a Fat Rat
Brown Fox Sleeps Like a Fat Walrus
Brown Fox Sleeps Like a Fat Wombat
Brown Fox Sleeps Like a Crazy Rat
Brown Fox Sleeps Like a Crazy Walrus
Brown Fox Sleeps Like a Crazy Wombat
Brown Fox Sleeps Like a Large Rat
Brown Fox Sleeps Like a Large Walrus
Brown Fox Sleeps Like a Large Wombat
Brown Fox Sleeps Unlike a Fat Rat
Brown Fox Sleeps Unlike a Fat Walrus
Brown Fox Sleeps Unlike a Fat Wombat
Brown Fox Sleeps Unlike a Crazy Rat
Brown Fox Sleeps Unlike a Crazy Walrus
Brown Fox Sleeps Unlike a Crazy Wombat
Brown Fox Sleeps Unlike a Large Rat
Brown Fox Sleeps Unlike a Large Walrus
Brown Fox Sleeps Unlike a Large Wombat
Brown Cat Jumps Like a Fat Rat
Brown Cat Jumps Like a Fat Walrus
Brown Cat Jumps Like a Fat Wombat
Brown Cat Jumps Like a Crazy Rat
Brown Cat Jumps Like a Crazy Walrus
Brown Cat Jumps Like a Crazy Wombat
Brown Cat Jumps Like a Large Rat
Brown Cat Jumps Like a Large Walrus
Brown Cat Jumps Like a Large Wombat
Brown Cat Jumps Unlike a Fat Rat
Brown Cat Jumps Unlike a Fat Walrus
Brown Cat Jumps Unlike a Fat Wombat
Brown Cat Jumps Unlike a Crazy Rat
Brown Cat Jumps Unlike a Crazy Walrus
Brown Cat Jumps Unlike a Crazy Wombat
Brown Cat Jumps Unlike a Large Rat
Brown Cat Jumps Unlike a Large Walrus
Brown Cat Jumps Unlike a Large Wombat
Brown Cat Eats Like a Fat Rat
Brown Cat Eats Like a Fat Walrus
Brown Cat Eats Like a Fat Wombat
Brown Cat Eats Like a Crazy Rat
Brown Cat Eats Like a Crazy Walrus
Brown Cat Eats Like a Crazy Wombat
Brown Cat Eats Like a Large Rat
Brown Cat Eats Like a Large Walrus
Brown Cat Eats Like a Large Wombat
Brown Cat Eats Unlike a Fat Rat
Brown Cat Eats Unlike a Fat Walrus
Brown Cat Eats Unlike a Fat Wombat
Brown Cat Eats Unlike a Crazy Rat
Brown Cat Eats Unlike a Crazy Walrus
Brown Cat Eats Unlike a Crazy Wombat
Brown Cat Eats Unlike a Large Rat
Brown Cat Eats Unlike a Large Walrus
Brown Cat Eats Unlike a Large Wombat
Brown Cat Sleeps Like a Fat Rat
Brown Cat Sleeps Like a Fat Walrus
Brown Cat Sleeps Like a Fat Wombat
Brown Cat Sleeps Like a Crazy Rat
Brown Cat Sleeps Like a Crazy Walrus
Brown Cat Sleeps Like a Crazy Wombat
Brown Cat Sleeps Like a Large Rat
Brown Cat Sleeps Like a Large Walrus
Brown Cat Sleeps Like a Large Wombat
Brown Cat Sleeps Unlike a Fat Rat
Brown Cat Sleeps Unlike a Fat Walrus
Brown Cat Sleeps Unlike a Fat Wombat
Brown Cat Sleeps Unlike a Crazy Rat
Brown Cat Sleeps Unlike a Crazy Walrus
Brown Cat Sleeps Unlike a Crazy Wombat
Brown Cat Sleeps Unlike a Large Rat
Brown Cat Sleeps Unlike a Large Walrus
Brown Cat Sleeps Unlike a Large Wombat
Brown Dog Jumps Like a Fat Rat
Brown Dog Jumps Like a Fat Walrus
Brown Dog Jumps Like a Fat Wombat
Brown Dog Jumps Like a Crazy Rat
Brown Dog Jumps Like a Crazy Walrus
Brown Dog Jumps Like a Crazy Wombat
Brown Dog Jumps Like a Large Rat
Brown Dog Jumps Like a Large Walrus
Brown Dog Jumps Like a Large Wombat
Brown Dog Jumps Unlike a Fat Rat
Brown Dog Jumps Unlike a Fat Walrus
Brown Dog Jumps Unlike a Fat Wombat
Brown Dog Jumps Unlike a Crazy Rat
Brown Dog Jumps Unlike a Crazy Walrus
Brown Dog Jumps Unlike a Crazy Wombat
Brown Dog Jumps Unlike a Large Rat
Brown Dog Jumps Unlike a Large Walrus
Brown Dog Jumps Unlike a Large Wombat
Brown Dog Eats Like a Fat Rat
Brown Dog Eats Like a Fat Walrus
Brown Dog Eats Like a Fat Wombat
Brown Dog Eats Like a Crazy Rat
Brown Dog Eats Like a Crazy Walrus
Brown Dog Eats Like a Crazy Wombat
Brown Dog Eats Like a Large Rat
Brown Dog Eats Like a Large Walrus
Brown Dog Eats Like a Large Wombat
Brown Dog Eats Unlike a Fat Rat
Brown Dog Eats Unlike a Fat Walrus
Brown Dog Eats Unlike a Fat Wombat
Brown Dog Eats Unlike a Crazy Rat
Brown Dog Eats Unlike a Crazy Walrus
Brown Dog Eats Unlike a Crazy Wombat
Brown Dog Eats Unlike a Large Rat
Brown Dog Eats Unlike a Large Walrus
Brown Dog Eats Unlike a Large Wombat
Brown Dog Sleeps Like a Fat Rat
Brown Dog Sleeps Like a Fat Walrus
Brown Dog Sleeps Like a Fat Wombat
Brown Dog Sleeps Like a Crazy Rat
Brown Dog Sleeps Like a Crazy Walrus
Brown Dog Sleeps Like a Crazy Wombat
Brown Dog Sleeps Like a Large Rat
Brown Dog Sleeps Like a Large Walrus
Brown Dog Sleeps Like a Large Wombat
Brown Dog Sleeps Unlike a Fat Rat
Brown Dog Sleeps Unlike a Fat Walrus
Brown Dog Sleeps Unlike a Fat Wombat
Brown Dog Sleeps Unlike a Crazy Rat
Brown Dog Sleeps Unlike a Crazy Walrus
Brown Dog Sleeps Unlike a Crazy Wombat
Brown Dog Sleeps Unlike a Large Rat
Brown Dog Sleeps Unlike a Large Walrus
Brown Dog Sleeps Unlike a Large Wombat