import java.io.*;
import java.util.*;

public class Solution {
    
    private static String solution(String a) {
        String funny = "Funny";
        String not_funny = "Not Funny";
        int l = a.length();
        if (l <= 2){
            return funny;
        }
        for(int i = 0; i < l/2; i++){
            char i1 = a.charAt(i);
            char i2 = a.charAt(i+1);
        }
        
        return a;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = Integer.parseInt(in.nextLine());
        for (int i = 0; i < t; i++) {
            String n = in.nextLine();
            System.out.println(solution(n));
        }
    }
}

@@ -375,16 +375,274 @@
 t(i+1);%0A
+            %0A            char j1 = a.charAt(l-i-1);%0A            char j2 = a.charAt(l-i-2);%0A            %0A            int diffDelta = Math.abs(i1-i2)-Math.abs(j1-j2);%0A            %0A            if(diffDelta != 0)%7B%0A                return not_funny;%0A            %7D%0A
         
@@ -667,17 +667,21 @@
  return 
-a
+funny
 ;%0A    %7D%0A

Update FunnyString.java