public static String mystery(String a, String b) {
    return (a.substring(0, a.length() / 2) + 
        b.substring(b.length() / 2));
}

System.out.println(mystery("Tabloid", "Igloos"));