Java program to kindergarten school kids

Java program to kindergarten school kids. A word is expected to be repeated five times by Kindergarten students. For instance, if the word is “running,” they must say “running.” Write a software that accepts the user’s string (word) as input and also gets the X and Y position of the character as input. If the characters in the Xth and Yth positions are the same, print “Same,” otherwise “Not Same.”

import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String str = sc.next();
int pos1 = sc.nextInt();
int pos2 = sc.nextInt();
String a="";
for (int i=1;i<=5;i++)
{
a+=str;
}
System.out.println(a);
if(a.charAt(pos1)==a.charAt(pos2)){
System.out.println("Same");
}
else{
System.out.println("Not Same");
}

}
}

run
34
45
runrunrunrunrun