import java.util.Scanner;
public class DNA {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNextLine()) {
String DNA = in.nextLine();
int n = Integer.valueOf(in.nextLine());
int len = DNA.length();
int minus = len - n;
int index = 0,max = 0;
for(int i = 0; i < minus; i++){
int gcCount = 0;
for(int j = i;j< i + n;j++){
if(DNA.charAt(j) == 'G' || DNA.charAt(j) == 'C'){
gcCount++;
}
}
if(gcCount > max){
max = gcCount;
index = i;
if(gcCount == n){
System.out.println(DNA.substring(index,index + n));
return;
}
}
}
System.out.println(DNA.substring(index,index + n));
}
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43