import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static String S = "hackerrank"; static boolean check(String s) { int p=0; int i=0; for (;;) { while (i