const line=readline();
const len=parseInt(readline());
const res=line.slice(0,len);
console.log(res)