let arr = [];
while(line = readline()) {
let num = readline();
for (let i=0; i<=line.length - num; i++){ //先切片
arr.push(line.substr(i, num));
}
}
let maxRate = 0;
let maxRateStr;
for (let item of arr) {
let gN = item.match(/G/g) ? item.match(/G/g).length : 0;
let cN = item.match(/C/g) ? item.match(/C/g).length : 0;
let rate = (gN + cN) / item.length;
if (rate > maxRate) { //获取GC率最高的,因为用的大于,即使评分一样也不会传入
maxRate = rate;
maxRateStr = item;
}
}
print(maxRateStr)