public class PeopleCircle {
public static void main(String args[]) {
new PeopleCircle();
}
public PeopleCircle() {
// String ret="mmmm";
// int index=0;
// System.out.println(ret.substring(0,index)+"f"+ret.substring(index));
System.out.println(order(25, 25, 1000));
}
public String order(int numMales, int numFemales, int K) {
char[] res = new char[numMales + numFemales];
for (int i = 0; i < res.length; i++) {
res[i] = 'M';
}
int nF = 0;
int index = 0;
int k = 0;
while (nF < numFemales) {
if (k == K - 1 && res[index] != 'F') {
res[index] = 'F';
nF++;
// System.out.println(new String(res) + ":" + index);
k = (k + 1) % K;
} else if (res[index] != 'F')
k = (k + 1) % K;
index = (index + 1) % res.length;
}
// System.out.println(nF);
return new String(res);
}
}
public static void main(String args[]) {
new PeopleCircle();
}
public PeopleCircle() {
// String ret="mmmm";
// int index=0;
// System.out.println(ret.substring(0,index)+"f"+ret.substring(index));
System.out.println(order(25, 25, 1000));
}
public String order(int numMales, int numFemales, int K) {
char[] res = new char[numMales + numFemales];
for (int i = 0; i < res.length; i++) {
res[i] = 'M';
}
int nF = 0;
int index = 0;
int k = 0;
while (nF < numFemales) {
if (k == K - 1 && res[index] != 'F') {
res[index] = 'F';
nF++;
// System.out.println(new String(res) + ":" + index);
k = (k + 1) % K;
} else if (res[index] != 'F')
k = (k + 1) % K;
index = (index + 1) % res.length;
}
// System.out.println(nF);
return new String(res);
}
}