function *main() {
  
  const [a, b] = (yield).split` `;
  const s = a.repeat(+b);
  const t = b.repeat(+a);
  console.log((s < t) ? s : t);
  
}
const iter = main();
iter.next();
require("readline").createInterface({input: process.stdin, output: process.stdout}).on("line", line => iter.next(line));
