@@ -0,0 +1,1192 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0A/**%0A*   Solution to https://www.hackerrank.com/challenges/sherlock-and-the-beast/%0A*/%0Apublic class Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A%0A        int tests = readInt(in);%0A%0A        for (int test = 0; test %3C tests; test++) %7B%0A            int n = readInt(in);%0A%0A            int fives = n / 3;%0A            while (fives %3E 0 &&%0A                  (n - (3 * fives)) %25 5 != 0)%0A            %7B%0A                fives--;%0A            %7D%0A%0A            int threes = n - (fives * 3);%0A%0A            if (threes %25 5 != 0) %7B%0A                System.out.println(%22-1%22);%0A            %7D%0A            else %7B%0A                StringBuilder sb = new StringBuilder();%0A%0A                for (int i = 0; i %3C fives * 3; i++) %7B%0A                    sb.append(%225%22);%0A                %7D%0A%0A                for (int i = 0; i %3C threes; i++) %7B%0A                    sb.append(%223%22);%0A                %7D%0A%0A                System.out.println(sb);%0A            %7D%0A        %7D%0A    %7D%0A%0A    private static int readInt(Scanner in) %7B%0A        return Integer.parseInt(in.nextLine().trim());%0A    %7D%0A%7D%0A

Create sherlock-and-the-beast.java