jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
/*       Rohan Balot
    NSIT, New Delhi, India  */
#include <bits/stdc++.h>
using namespace std;

#define FIND(c, e) (c).find(e) != (c).end()
#define NFIND(c, e) (c).find(e) == (c).end()
#define ALL(t) (t).begin(), (t).end()
#define ALLR(t) (t).rbegin(), (t).rend()
#define MP make_pair

const int N = int( 1e5 ) + 2;
const int Q = int( 1e5 ) + 2;
const int M = int( 1e6 ) + 2;
const int MOD = int( 1e9 ) + 7;
const double PI = acos(-1.0);
const double eps = 1.0e-6;



struct node {
	vector< pair< int, int > > v; // divisor[a[i]]
	int size;
	int sum;
} tree[N << 2];


// prime stuff
const int PRIME_TILL = M;
vector<bool> isprime(PRIME_TILL , true);
vector<int> prime;
vector<int> pf(PRIME_TILL);
vector< pair<int, int > > divisor[M];
// array stuff
int a[N];
vector<int> f(PRIME_TILL, 0);
int n;
vector<int> freq(M, 0);


int expo(int num, int p)
{
	int e = 0;
	while (num % p == 0) {
		e++;
		num /= p;
	}
	return e;
}
void sieve(int n = PRIME_TILL)
{
	isprime[0] = isprime[1] = false;
    for (int p = 2; p < n; p++) {
        if (isprime[p]) {
            for (int i = p; i < n; i += p) {
                isprime[i] = false;
				if(p <= i) {
					int e = expo(i, p);
					if(e > 0)
						divisor[i].push_back(MP(p, e));
				}
			}
        }
    }
}
int binary(vector< pair<int, int > > v, int num)
{
	int low = 0;
	int high = v.size() - 1;
	while (low <= high) {
		int mid = low + (high - low) / 2;
		if(v[mid].first == num) {
			return v[mid].second;
		} else if(v[mid].first > num) {
			high = mid - 1;
		} else {
			low = mid + 1;
		}
	}
	return -1;
}
// TODO : possible optimization , use vector<int> prime
void factors()
{
	for(int i = 2; i < PRIME_TILL; i++) {
		if(isprime[i]) {
			for(int j = i; j < PRIME_TILL; j += i) {
				int e = expo(j, i);
				divisor[j].push_back(MP(i, e));
				f[i] += e * freq[j];
			}
		}
	}
	for(int i = 1; i < PRIME_TILL; i++) {
		f[i] += f[i - 1];
	}
}

long long func(int l, int r, int x, int y)
{
    long long ans = 0LL;
	for(int i = x; i <= y; i++) {
			ans += (f[r] - f[l - 1]);
			//for(int j = l; j <= r; j++) {
			//	int n = a[j], e = 0;
			//	while(n % prime[i] == 0) {
			//		e++;
			//		n /= prime[i];
			//	}
			//	ans += e;
			//}
    }
    return ans;
}
void __answer()
{
    int n;
    cin >> n;
    vector<int> v(n);
    for(int i = 0; i < n; i++) {
        cin >> v[i];
    }
    sort(ALL(v));
    int ans = 0;
    for(int i = 0; i + 1 < n; i++)
        ans += v[i + 1] - v[i];
    cout << ans;
}
int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    #ifdef LOCAL
        freopen("sample_input.txt", "r", stdin);
    	// freopen("data.txt", "w", stdout);
    	// freopen("log.txt", "w", stderr);
    #endif
    __answer();
    return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(){
	int N;
	scanf("%d",&N);
	int a[N];
	for(int i=0; i<N; i++){
		scanf("%d",&a[i]);
	}

	int min = a[0];
	int max = a[0];

	for(int i=1; i<N; i++){
		if(a[i] > max){
			max = a[i];
		}
		if(a[i] < min){
			min = a[i];
		}
	}

	printf("%d\n",max - min);

	return 0;
}
//  [c]
#include <stdio.h>

int main(){
    int n;
    int a[100];
    int i;
    int max = 0;
    int min = 1000;

    scanf("%d",&n);

    for(i = 0;i < n;i++){
        scanf("%d",&a[i]);
    }

    for(i = 0;i < n;i++){
        if(a[i] > max) max = a[i];
        if(a[i] < min) min = a[i];
    }

    printf("%d",max - min);

    return 0;
}
//  [c]
	#include <stdio.h>
    int main(void){
	int a,b;
	int max = 0;
	int min = 1000;
	scanf("%d\n",&a);
	for (b = 0; b < a; b++){
		int c;
		scanf("%d",&c);
		if(c > max)
		max = c;
		if(c < min)
		min = c;
	}
	printf("%d\n", max-min);
	return 0;
}
//  [c]
#include<stdio.h>


int main(){

  int n, a, i, max=0, min=1000;

  scanf("%d", &n);

  for(i=0;i<n;i++){
    scanf("%d", &a);
    if(a>max) max=a;
    if(a<min) min=a;
  }

  printf("%d\n", max-min);


  return 0;
}
//  [c]
#include <stdio.h>
 
int main(void)
{
  
    int n,a[1000],max,min,i;
      
     scanf("%d",&n);
  
     for(i=0;i<n;i++){
         scanf("%d",&a[i]);
     }
     
     max=a[0];   min=a[0];
  
     for(i=0;i<n;i++){
         if(max<a[i])      max=a[i];
         else if(min>a[i]) min=a[i];
     }  
    
     printf("%d",max-min);
  
     return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int compare_int(const void *a, const void *b){
  return *(int*)a - *(int*)b;
}

int main(){
  int     n, a[100] = {0};
  scanf("%d", &n);
  for(int i=0; i<n; i++){ scanf("%d", &a[i]); }
  qsort( a, n, sizeof(int), compare_int );
  
  printf("%d", a[n-1]-a[0]);
  
  return 0;
}
//  [javascript]
function Main(input){
	input = input.split("\n");
	input = input[1].split(" ").map(Number);
	console.log(Math.max.apply(null,input)-Math.min.apply(null,input));
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function myout(text){console.log(text);}//standard output
function Main(input) {
	//input = parseInt(input);
	//input = input.split(" ");
	input = input.split("\n");
	//input = input.split(" ").map((a)=>Number(a));
	//input = input.split("\n").map((a)=>Number(a));
  var list = input[1].split(" ").map((a)=>Number(a));
  myout(Math.max.apply(null,list) - Math.min.apply(null,list));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function main(s) {
	s = s.split("\n")[1].split(" ").map(x => Number(x));
	var x = 1000;
	var y = 0;
	for (var i = 0; i < s.length; i++) {
		if (s[i] < x) {x = s[i];}
		if (s[i] > y) {y = s[i];}
	}
	console.log(y-x);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    input = input.split("\n");
    var line = input[0].split(" ");
    var num = parseInt(line[0]);
    var max = 0;
    var min = 10000;
    var data = input[1].split(" ");

    for(var i = 0;i<num;i++){
        data[i] = parseInt(data[i]);        
    }
    
    for(var i = 0;i<num;i++){
        if(max<data[i]){
            max = data[i];
        }
        
        if(min>data[i]){
            min = data[i];
        }
    }
    
    
    console.log(max-min);

}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    input = input.split("\n");
    var house_num = Number(input[0]);
    var houses = input[1].split(' ');
    var smallest = houses[0];
    var largest = 0;
    for(var i = 0; i < houses.length; i++){
        if(houses[i] > largest){
            largest = houses[i];
        }
        if(houses[i] < smallest){
            smallest = houses[i];
        }
    }
    var answer = largest - smallest;
    console.log(answer);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');
// Here your code !
process.stdin.on('data', function(chunk){
    var lines = chunk.toString().split("\n");
    var N = parseInt(lines[0]);
    var a = lines[1];
    var A =a.split(" "); 
    
    var min = A[0];
    var max = A[0];
    
    
    for(i=0; i<N; i++){
        min = Math.min(min,A[i]);
    }

    for(i=0; i<N; i++){
        max = Math.max(max,A[i]);
    }

/*
    console.log(min);
    console.log(max);
*/
    var ans = max-min;  
    console.log(ans);
});
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var n int
	con.Scan(&n)
	min := 1000
	max := 0
	for i := 0; i < n; i++ {
		var a int
		con.Scan(&a)
		if a > max {
			max = a
		}
		if a < min {
			min = a
		}
	}
	con.Println(max - min)
	return nil
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	N := nextInt()
	min := 1000
	max := 0
	for i := 0; i < N; i++ {
		a := nextInt()
		if a < min {
			min = a
		}
		if a > max {
			max = a
		}
	}
	fmt.Println(max - min)
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	iv, _ := strconv.Atoi(sc.Text())
	return iv
}

func init() {
	sc.Split(bufio.ScanWords)
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func main() {
	n := scanInt()
	mx := math.MinInt64
	mn := math.MaxInt64
	for i := 0; i < n; i++ {
		a := scanInt()
		mx = max(mx, a)
		mn = min(mn, a)
	}
	fmt.Println(mx - mn)
}
//  [go]
package main

import (
	"fmt"
	"sort"
)

func main() {
	// Code for B - Traveling AtCoDeer Problem
	var N int
	fmt.Scanf("%d", &N)

	A := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &A[i])
	}

	sort.Sort(sort.IntSlice(A))
	fmt.Println(A[len(A)-1] - A[0])
}
//  [go]
package main
 
import (
  "fmt"
)
 
func main() {
  var N, a int
  fmt.Scan(&N)
  
  min := 1000
  max := 0
  for i := 0; i < N; i++ {
    fmt.Scan(&a)
    if min > a {
      min = a
    }
    if max < a {
      max = a
    }
  }
  
  ans := max - min
  fmt.Printf("%d\n", ans)
}
//  [ruby]
n = gets
a = gets.split.map(&:to_i)
print a.max - a.min
//  [ruby]
N = gets.to_i
a = gets.split.map(&:to_i)
ans = (a.max - a.min)

puts ans
//  [ruby]
_ = gets
a = gets.chomp.split.map(&:to_i).sort!
puts a[-1] - a[0]
//  [ruby]
require 'prime'
require 'set'
require 'tsort'
include Math
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end


n = gif

a = gi
a.sort!
puts a.last-a.first
//  [ruby]
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)
puts a.max - a.min
//  [rust]
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let n:i32 = procon_read()[0];
	let mut a:Vec<i32> = procon_read();
	a.sort();
	println!("{}", a[(n-1) as usize] - a[0]);
}
//  [rust]


fn main() {
    let n: usize = read();
    let mut mx = 0i32;
    let mut mn = 10001i32;
    for _i in 0..n {
        let a: i32 = read();
        mx = max(mx, a);
        mn = min(mn, a);
    }
    let ans = mx - mn;
    println!("{}", ans);
}

// 以下関数


use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub const MOD: u64 = 1_000_000_007;

pub fn is_prime(n: i32) -> bool {
    if n < 2 {
        return false;
    } else if n == 2 {
        return true;
    }
    let mut i = 2;
    while i * i < n {
        if n % i == 0 {
            return false;
        } else {
            i += 1;
            continue;
        }
    }
    true
}

pub fn lcm(mut n: i32, mut m: i32) -> i32 {
    n = if n > m { m } else { n };
    m = if n > m { n } else { m };
    let mut i = n;
    while i % m != 0 {
        i += n;
    }
    i
}

pub fn abs(n: i32) -> i32 {
    if n >= 0 {
        n
    } else {
        -n
    }
}

pub fn max(n: i32, m: i32) -> i32 {
    if n >= m {
        n
    } else {
        m
    }
}

pub fn min(n: i32, m: i32) -> i32 {
    if n <= m {
        n
    } else {
        m
    }
}

pub fn factorial(n: u32) -> u32 {
    if n == 0 {
        return 1
    }
    let mut r = n;
    for i in 0..n-1{
        r *= n-i-1;
    }
    r
}

pub fn combination(n: u32, m: u32) -> u32 {
    factorial(n) / factorial(m) / factorial(n-m)
}
//  [rust]
use std::str::FromStr;

fn get_one<T : FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().parse().ok().unwrap();
}

fn get_vec<T : FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect();
}

fn main() {
    let n : usize = get_one();
    let v : Vec<i32> = get_vec();
    let ans = v.iter().max().unwrap() - v.iter().min().unwrap();
    println!("{}", ans );
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        N: usize,
        homes: [i32; N]
    }

    let min = homes.iter().min().unwrap();
    let max = homes.iter().max().unwrap();

    println!("{}", max - min);
}
//  [rust]
fn main() {
	proconio::input!{
		n: usize,
		mut a: [usize; n],
	}

	a.sort();
	println!("{}", a.last().unwrap() - a[0]);
}
//  [rust]
use proconio::*;
use std::cmp::*;
use std::vec::Vec;

fn main() {
    input! {
        n: usize,
        mut A: [i32; n],
    }
    A.sort();
    let res = A[n - 1] - A[0];
    println!("{}", res);
}
//  [swift]
let _=readLine(),a=readLine()!.characters.split(" ").map{Int(String($0))!};print(a.maxElement()!-a.minElement()!)
//  [swift]
import Foundation
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

_ = readLine()
let ai = readInts()
print(ai.max()! - ai.min()!)
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1];}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const objvs =(a)=>{const b=[];for(const v in a){b.push(a[v])}return b};
const main=()=>{
  let n=tn()
  let nr=tnn(n)
  to(max(...nr)-min(...nr))
}
main()
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const N = Number(input[0][0]);
  const A = input[1].map(Number);

  A.sort((a, b) => a - b);

  return A[N - 1] - A[0];
};

console.log(main(read()));
//  [typescript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let N = parseInt(xs[0]);
   let S = xs[1].split(' ').map(v=>parseInt(v,10));
   let max1 = Math.max(...S);
   let min1 = Math.min(...S);
   console.log(max1-min1);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [python]
import numpy as np

X = int(input())
#print(X)


def MaxPow(X):
    Max = 1

    if int(np.sqrt(X)) ==1:
        return Max
    
    for b in range(2,int(np.sqrt(X))+1):
        #print(np.log(X)/np.log(b))
        for p in range(2,int(np.log(X)/np.log(b))+2):
            tmp = b**p
            if tmp<=X:
                Max = max(Max,tmp)
    return Max

print(MaxPow(X))


# for i in range(1000):
#     print(MaxPow(i))
//  [python]
# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np

n = int(input())

a=[0]*1001  # リスト

for i in range(1,33):
    for j in range(2,10):
        k = i ** j
        if k > 1000:
            break
        else:
            a[k] = 1

for i in range(n,0,-1):
    if(a[i]==1):
        print(i)
        break
//  [python]
import numpy as np
x = int(input())
num = [0]
for b in range(1, int(np.sqrt(x))+1):
    for p in range(2, 11):
        if b**p <= x:
            num.append(b**p)
        if b**p > x:
            break
print(max(num))
//  [java]
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int i=0;
    //べき乗数を後ろから探す
    for(i=X;i>0;i--){
      if(judge(i)){
        break;
      }
    }
    System.out.println(i);
  }
    //べき乗数かどうか
    private static boolean judge(int n){
      boolean re = false;
      if(n==1){//１のとき
        re = true;
      }else{//１以外なら
        for(int i=2;i<n;i++){
          for(int j=1;j<n;j++){
            int m = (int)Math.pow(i,j);
            if(m==n){
              re = true;
              break;
            }
          }
        }
      }
        return re;
      }
}
//  [java]
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;


class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int x = sc.nextInt();
    	int xx = x / 2;
    	int ans = 0;

    	for(int i = 1; i <= x; i++){
    		for(int j = 2; j <= x + 1; j++){
    			if(Math.pow(i, j) > ans && Math.pow(i, j) <= x){
    				ans = (int)Math.pow(i, j);
    			}
    		}
    	}

    	System.out.println(ans);
    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
    return string(1, val);
}

int main(){
    int X; cin >> X;

    int res = 0;
    for(int i = 1; i <= 100; ++i) {
        for(int k = 2; k <= 100; ++k) {
            for(int m = 1; m <= X; ++m) {
                int tmp = pow(i, k);
                if(tmp == m) {
                    if(res < tmp) {
                        res = tmp;
                    }
                }
            }
        }
    }

    cout << res << endl;
}
//  [cpp]
#include <iostream>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <stdio.h>
#include <string>
#include <string.h>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <stdlib.h>

using namespace std;

int main (void)
{
	long x;
	cin >> x;
	int co = 0;

	for (int i = 1; i < x + 1; i++)
	{
		int p = 0;
		for (int j = 1; j < 100; j++)
		{
			for (int k = 2; k < 100; k++)
			{
				if (i == pow(j,k))
				{
					p++;
					if (co < i)
					{
						co = 0;
						co = i;
					}
					break;
				}
			}
			if (p != 0)
			{
				break;
			}
		}
	}

	cout << co << endl;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int xyz(int a, int b)
{
	if(b == 0)
	{
		return 1;
	}
	else
	{
		return a * xyz(a, b - 1);
	}
}

int main()
{
	int x;
	cin >> x;
	
	int ans = 0;
	for(int i = 1; i <= x; i++)
	{
		for(int j = 2; j < x + 2; j++)
		{
			if(ans < xyz(i, j) && xyz(i, j) <= x)
			{
				ans = xyz(i, j);
			}
		}
	}
	
	cout << ans << endl;
	return 0;
}
//  [c]
#include <math.h>
#include <stdio.h>

int ispower(int n) {
	int a, b;

	for (a = 1; a < 50; a++)
		for (b = 2; b < 50; b++)
			if (pow(a, b) == n)
				return 1;
	return 0;
}

int main() {
	int x, n, max;

	scanf("%d", &x);
	max = 0;
	for (n = 1; n <= x; n++)
		if (ispower(n) && max < n)
			max = n;
	printf("%d\n", max);
	return 0;
}
//  [javascript]
function Main(input){
	input=input.split(/\n|\s/);
	input.forEach(function(e,i,a){a[i]=Number(a[i]);});
	
	var arr=[1000, 961, 900, 841, 784, 729, 729, 729, 676, 625, 625, 576, 529, 512, 512, 484, 441, 400, 361, 343, 324, 289, 256, 256, 256, 243, 225, 216, 196, 169, 144, 128, 125, 121, 100, 81, 81, 64, 64, 64, 49, 36, 32, 27, 25, 16, 16, 9, 8, 4, 1];
	var a=1;
	for(var i=0;i<arr.length;i=(i+1)|0){
		if(input[0]>=arr[i]){a=arr[i];break;}
	}
	console.log(a);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main (input) {
  const num = parseInt(input.split(/\s/g)[0]);

  if (num === 1) return console.log('%s', 1);

  const pattern = new Array(num).fill('')
    .map((value1, index1) => {
      return new Array(num).fill('').map((value2, index2) => Math.pow(index1 + 1, index2 + 1));
    })
    .map((values) => (
      values.filter((value, index) => {
        if (index === 0) return false;
        return value <= num;
      })
    ))
    .filter((values) => values.length)
    .map((values) => Math.max(...values));
  console.log('%s', Math.max(...pattern));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  const x = parseInt(input.trim(), 10)

  let b = new Set([1])

  for (let j = 2; j <= 10; j++) {
    for (let i = 2; i ** j <= x; i++) {
      b.add(i ** j)
    }
  }

  console.log(Math.max(...b))
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	parseProblem()
}

func parseProblem() {
	x := scanInt(sc)
	max := 1
	for i := 2; i*i <= x; i++ {
		cur := i * i
		for cur <= x {
			if max < cur {
				max = cur
			}
			cur *= i
		}
	}
	fmt.Println(max)
}

func resolve(n int) int {
	return n
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	n := nextInt()
	ansmax := 0

	for i := 1; i*i <= n; i++ {
		// iのpowの最大値を求める
		ipowmax := 0
		for j := 0; j <= 10; j++ {
			if pow(i, j) <= n {
				ipowmax = max(ipowmax, pow(i, j))
			}
		}
		ansmax = max(ansmax, ipowmax)
	}

	fmt.Println(ansmax)

}
func pow(a, b int) int {
	var ret int = 1
	for b > 0 {
		if (b & 1) == 1 {
			ret *= a
		}
		a *= a
		b >>= 1
	}
	return ret
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [ruby]
require 'prime'

x = gets.chomp.to_i

max = 0

(1..x).each do |base|
  y = base
  (2..x + 1).each do |exp|
    y *= base
    if y <= x then
      max = [max, y].max
    end
  end
end

puts max.to_s
//  [ruby]
X = gets.to_i

puts 1 if (X == 1 || X == 2 || X == 3)

X.downto(0).each do |i|
  1.upto(i).each do |b|
    2.upto(i/b).each do |p|
        if b ** p == i
          puts i
          exit
        elsif b ** p > i
          next
        end
    end
  end
end
//  [ruby]
X = gets.chomp.to_i
ans = 1
(2..X).each do |p|
  (1..X**0.5).each do |b|
    if X >= b**p && ans <= b**p
      ans = b**p
    end
  end
end
puts ans
//  [rust]
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        x: u64,
    }
    let mut ans = 1;
    for i in 1..x {
        for j in 2..x as u32 {
            if i.pow(j) > ans && i.pow(j) <= x {
                ans = i.pow(j)
            }
        }
    }

    println!("{}", ans);
}
//  [rust]
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut memo = vec![false; 1001];
    for b in 1..1000 {
        for p in 2..1000 {
            let x = (b as i64).pow(p) as usize;
            if x < 1001 { memo[x] = true; }
        }
    }
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    for x in (1..n+1).rev() {
        if memo[x] {
            put!(x);
            return;
        }
    }
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> { self.cin::<String>().chars().collect() }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> { (0..n).map(|_| self.cin()).collect() }
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        x: usize,
    }

    if x==1 {
        println!("{}", 1);
        return;
    }

    let mut ans: Vec<i64> = Vec::new();
    for b in 2..34 {
        for p in 2..11 {
            if (b as i64).pow(p) <= x as i64 {
                ans.push((b as i64).pow(p));
            }
        }
    }

    ans.sort();
    ans.reverse();
    println!("{}", ans[0]);

    // for i in (1..x+1).rev() {
    //     let mut tmp: Vec<usize> = vec![0;i+5];
    //     for j in 2..i+1 {
    //         let mut a = i;
    //         if i%j==0 {
    //             while a%j==0 {
    //                 tmp[j] += 1;
    //                 a /= j;
    //                 debug!(a);
    //             } 
    //         }
    //     }
    //     tmp.sort();
    //     tmp.reverse();
    //     debug!(tmp);
    //     let mut ok = false;
    //     if tmp[0]>=2 {
    //         ok = true;
    //         for k in 2..tmp.len() {
    //             if tmp[k]!=0 {
    //                 ok = false;
    //             }
    //         }
    //     }
    //     if ok {
    //         println!("{}", i);
    //         return;
    //     }
    // }

}
//  [typescript]
class Scanner {
  private buffer = '';
  private stdinQueue: any = [];

  constructor() {
    process.stdin.resume();
    process.stdin.setEncoding('utf8');
    process.stdin.on(
      'data',
      (chunk): void => {
        this.buffer += chunk;
        while (this.stdinQueue.length > 0) {
          const i = this.buffer.indexOf('\n');
          if (i < 0) {
            break;
          }
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          this.stdinQueue.shift()(line);
        }
      },
    );
  }
  public getLine(): Promise<string> {
    return new Promise((resolve, reject) => {
      const i = this.buffer.indexOf('\n');
      if (i >= 0 && this.stdinQueue.length == 0) {
        let line = this.buffer.substr(0, i);
        if (line.endsWith('\r')) {
          line = line.slice(0, -1);
        }
        this.buffer = this.buffer.substr(i + 1);
        resolve(line);
      } else {
        this.stdinQueue.push(resolve);
      }
    });
  }

  public close(): void {
    process.stdin.pause();
  }
}

async function slove() {
  const sc = new Scanner();
  const x = +(await sc.getLine());
  const set = new Set<number>([1]);
  for (let b = 2; b <= x; b++) {
    for (let p = 2; p <= x; p++) {
      const t = Math.pow(b, p);
      if (t <= x) {
        set.add(t);
      }
      if (t >= x) {
        continue;
      }
    }
  }
  console.log(Math.max(...Array.from(set)));
  sc.close();
}

slove();
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const X = Number(input[0][0]);

  let answer = 1;

  for (let i = 2; i <= Math.sqrt(X); i++) {
    let power = i ** 2;

    while (power * i <= X) {
      power *= i;
    }

    answer = Math.max(answer, power);
  }

  return answer;
};

console.log(main(read()));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const n = Number(stdin.split('\n')[0])

const ans = _ => {
  const arr = Array(n)
    .fill(0)
    .map((_, i) => i + 1)

  const exps = arr.filter(num => {
    if (num === 1) {
      return true
    }

    for (let i = 2; i < num; i++) {
      for (let j = 2; i ** j <= num; j++) {
        const pow = i ** j
        if (pow === num) {
          return true
        }
      }
    }
    return false
  })

  return Math.max(...exps)
}

console.log(ans())
//  [python]
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import numpy as np
import scipy as sp

def main():
    while True:
        try:
            il = [input() for i in range(3)]
            N = int(il[0])
            S = il[1]
            K = int(il[2])

            res = ''.join(['*' if s != S[K-1] else s for s in S])

            print(res)


        except:
            break

if __name__ == '__main__':
    main()
//  [python]
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math


N = int(input())
S = str(input())
K = int(input())


ans = ""

for i in range(N):
    if S[K-1] == S[i]:
        ans += S[K-1]
    else:
        ans += "*"

print(ans)
//  [python]
from sys import stdin
# import math
import numpy as np
# N = int(stdin.readline().rstrip().split()[0])
# A = [int(x) for x in stdin.readline().rstrip().split()]
# N, X = [int(x) for x in stdin.readline().rstrip().split()]
# S = stdin.readline().rstrip().split()[0]

N = int(stdin.readline().rstrip().split()[0])
S = stdin.readline().rstrip().split()[0]
K = int(stdin.readline().rstrip().split()[0])

K = K-1

S_k = S[K]
arr = ""
for s in S:
  if s==S_k:
    arr += s
  else:
    arr += "*"
print(arr)
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int k = sc.nextInt();
        String ss = s.substring(k - 1, k);
        for (int i = 0; i < n; i++) {
            String ans = s.substring(i, i + 1);
            if(ans.equals(ss)) System.out.print(ans);
            else System.out.print("*");
        }
    }
}
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
      	String k = sc.next();
      	int s = sc.nextInt();
      	String ans = "";
      	char c = k.charAt(s-1);
      	for(int i=0;i<n;i++){
          if( k.charAt(i) == c ){
          	ans += ""+k.charAt(i);
          }else{
            ans += "*";
          }
        }
      System.out.println(ans);
	}
}
//  [java]
import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(bf.readLine());
        String S = bf.readLine();
        int K = Integer.parseInt(bf.readLine());
        String s = S.substring(K-1, K);
        for(int i = 0; i < N; i++){
            String ss = S.substring(i, i+1);
            if(!ss.equals(s)){
                S = S.replace(ss, "*");
            }
        }
        System.out.println(S);
    }
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;string s;cin>>n>>s>>k;
    for (int i = 0; i < n; i++)
    {
        /* code */
        if (s[i]!=s[k-1])
        {
            /* code */
            s[i]='*';
        }
        
    }
    cout<<s<<endl;
}
//  [cpp]
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    int N, K; string S; cin >> N >> S >> K;
    for (int i = 0; i < N; ++i) if (S[i] != S[K - 1]) S[i] = '*';
    cout << S << endl;
}
//  [cpp]
#include <stdio.h>
#include <string>
#include <algorithm>
#include <iostream>
#include <cmath>
using namespace std;
const static int MAX = 10;

int n, k;
char S[MAX], r;
string s;

int main() {
    scanf("%d", &n);
    scanf("%s", S);
    s = S;
    scanf("%d", &k);
    r = s[k-1];

    for ( int i = 0; i < n; i++ ) {
        if ( s[i] != r ) {
            s[i] = '*';
        }
    }
    
    printf("%s\n", s.c_str());
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main (void)
{
    int n,k;
    char s[10];
    scanf("%d",&n);
    scanf("%s",s);
    scanf("%d",&k);
    for(int i=0;i<n;i++)
    {
        if(s[i]!=s[k-1])
        {
            s[i]='*';
        }
    }
    printf(s);
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void)
{
  int n,k;
  char s[20];
  scanf("%d %s %d",&n,s,&k);
  char tmp=s[k-1];
  int len=strlen(s);
  for(int i=0;i<len;i++){
    if(s[i]!=tmp){
      s[i]='*';
    }
  }

  printf("%s\n",s);
  return 0;
}
//  [c]
int N, K;
char s[11];
int main(){
	scanf("%d%s%d", &N, s, &K);
	K--;
	for(int i=0; i<N; i++){
		putchar(s[i]==s[K]?s[K]:'*');
	}
	putchar(10);
	return 0;
}
//  [javascript]
function Main(input) {
  lines = input.split('\n');
  n = lines[0]
  s = lines[1]
  k = lines[2]
  c = s[k-1]
  re = new RegExp('[^' + c + ']', 'g')
  console.log(s.replace(re,'*'))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    N = Number(input.split("\n")[0]);
    S = input.split("\n")[1].split("");
    K = Number(input.split("\n")[2]);
    answer = ""
    
    letter = S.slice(K-1, K);
    
    for(i = 0; i<N;i++){
        if(S[i] !== String(letter)){
            S[i]="*";
        }
        answer += S[i];
    }
    console.log(answer);
    
}
    


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'
function main(input) {
  input = input.trim().split('\n')
  const num = input[2]
  let text = input[1]
  const char = new RegExp(`[^${text[num-1]}]`, 'g')
  text = text.replace(char, '*');
  console.log(text)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}
func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}
func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	_ = iScan()
	s := Scan()
	k := iScan()
	for _, v := range s {
		if string(v) == string(s[k-1]) {
			fmt.Print(string(v))
		} else {
			fmt.Print("*")
		}
	}
	fmt.Println("")
}
//  [ruby]
n = gets.chomp.to_i
s = gets.chomp
k = gets.chomp.to_i

n.times do |i|
	s[i] = "*" if s[i] != s[k-1]
end
puts s
//  [ruby]
N = gets.to_i
S = gets.chomp
K = gets.to_i
remain = S[K-1]
for i in 0...N do
    if S[i]!=remain
        S[i]='*'
    end
end
puts S
//  [ruby]
n,s,k=*$<
$><<s.chomp.chars.map{_1==s[k.to_i-1]? _1:?*}.join
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use itertools::Itertools;
use std::process::exit;
use std::cmp::*;
use num::*;
use num::integer::Roots;

fn main() {
    input! {
    a:usize,
    b:String,
    c:usize,
    }
    let mut b=b.chars().collect_vec();
    let e=b[c-1];
    for i in 0..b.len(){
        if b[i]!=e{
            b[i]='*'
        }
    }
    let b:String=b.iter().collect();
    println!("{}",b)
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::cmp::max;
use std::cmp::min;
use std::collections::HashMap;
use std::collections::VecDeque;

fn main() {
    input! {
        N: usize,
        S: String,
        K: usize,
    }

    let c: &str = &S[K - 1..=K - 1];

    for i in 0..N {
        if &S[i..=i] == c {
            print!("{}", &S[i..=i]);
        } else {
            print!("*");
        }
    }

    println!("");
}
//  [rust]
use proconio::input;

fn main() {
    input!(n: usize, s: proconio::marker::Chars, k: usize);
    let sk = s[k - 1];
    println!(
        "{}",
        s.iter()
            .map(|&c| if c == sk { c } else { '*' })
            .collect::<String>()
    );
}
//  [typescript]
namespace Coder {
  class Scanner {
    private buffer: string = '';
    private stdinQueue: any = [];

    constructor() {
      process.stdin.resume();
      process.stdin.setEncoding('utf8');
      process.stdin.on(
        'data',
        (chunk): void => {
          this.buffer += chunk;
          while (this.stdinQueue.length > 0) {
            const i = this.buffer.indexOf('\n');
            if (i < 0) {
              break;
            }
            let line = this.buffer.substr(0, i);
            if (line.endsWith('\r')) {
              line = line.slice(0, -1);
            }
            this.buffer = this.buffer.substr(i + 1);
            this.stdinQueue.shift()(line);
          }
        },
      );
    }
    public getLine(): Promise<string> {
      return new Promise((resolve, reject) => {
        const i = this.buffer.indexOf('\n');
        if (i >= 0 && this.stdinQueue.length === 0) {
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          resolve(line);
        } else {
          this.stdinQueue.push(resolve);
        }
      });
    }

    public async getNumbers(): Promise<number[]> {
      return (await this.getLine()).split(' ').map((x) => +x);
    }

    public async getStrings(): Promise<string[]> {
      return (await this.getLine()).split(' ');
    }

    public close(): void {
      process.stdin.pause();
    }
  }

  async function solve() {
    const sc = new Scanner();
    const N = (await sc.getStrings())[0];
    let S = (await sc.getStrings())[0];
    const K = (await sc.getNumbers())[0];

    const regex = new RegExp(`[^${S[K - 1]}*]`);

    while (S.match(regex) !== null) {
      S = S.replace(regex, '*');
    }
    console.log(S);

    sc.close();
  }

  solve();
}
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const [n] = input[0].split(" ").map((x: number): number => +x);
const [s] = input[1].split(" ").map((x: string): string => x);
const [k] = input[2].split(" ").map((x: number): number => +x);

const v = s[k-1];
const out = Array(n).fill().reduce((acc, current, i, a)=>{
  if(s[i] === v){
    return acc + v
  }
  return acc+'*'
}, '');

console.log(out)
//  [python]
import random
import numpy
import sys
import math

N=float(input()) #人数
print(math.floor(N/3))
//  [python]
import numpy as np
import scipy as sp

N = int(input())

a = N // 3

print(a)
//  [python]
n=int(input())
print(n//3)
//  [java]
import java.util.Scanner;

class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = sc.nextInt();
        System.out.println(n/3);
    }
}
//  [java]

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        
        int x = s.nextInt() / 3;
        System.out.println(x);
    }
    
}
//  [cpp]
#define _USE_MATH_DEFINES // for C++  
#include "bits/stdc++.h"
#define LL long long
#define NUM 1000000007

using namespace std;

int main()
{
    int n;
    cin >> n;
    cout << n / 3 << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  int n;
  cin>>n;
  int ans=n/3;
  cout(ans);
  return 0;
}
//  [cpp]
#include <iostream>
#include <algorithm>
#include <string>
#include <functional>
#include <math.h>
#include <map>
#include <vector>
using namespace std;

int main() {
	int n;
	cin >> n;
	n = n - (n % 3);
	n /= 3;
	cout << n << endl;

	return 0;
}
//  [c]
#include <stdio.h>

int main(){
    int N;
    int ans=0;

    scanf("%d",&N);
    
    ans=N/3; 
    printf("%d\n",ans);

    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int x;
    scanf("%d",&x);
    printf("%d",x/3);
    return 0;

}
//  [c]
#include<stdio.h>
int main()
{
	int n,x;
	scanf("%d",&n);
	x=n/3;
	printf("%d\n",x);
}