jiahuimbzuai/CoQuIR huggingface dataset:
//  [typescript]
import * as fs from "fs";
const input = (fs.readFileSync("/dev/stdin", "utf8") as string)
  .split("\n")
  .map(Number);
const remainingMoney: number = (input[0] - input[1]) % input[2];
console.log(remainingMoney);
//  [typescript]
import * as fs from "fs";
const input = (fs.readFileSync("/dev/stdin", "utf8") as string)
  .split("\n")
  .map(Number);
let remainingMoney: number = input[0];
remainingMoney -= input[1];
const donutsCount: number = Math.floor(remainingMoney / input[2]);
remainingMoney -= input[2] * donutsCount;

console.log(remainingMoney);
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,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 ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let[a,b,c]=nrin(3)
  out(a-b-floor((a-b)/c)*c)
}
main()
//  [typescript]
const Node = function (val) {
  this.val = val;
  this.parent = this;
  this.rank = 1;
  this.weight = 0; // 親に対してのweight
};

const WeightedDisjointSet = function () {
  this.m = [];
};

WeightedDisjointSet.prototype.add = function (val) {
  this.m[val] = new Node(val);
};

WeightedDisjointSet.prototype.merge = function (val1, val2, weight) {
  const p1 = this.find(val1);
  const p2 = this.find(val2);
  const w1 = this.weight(val1);
  const w2 = this.weight(val2);
  if (p1 === p2) {
    if (w2 - w1 !== weight) {
      throw Error("invalid weight");
    }
    return;
  }
  if (p1.rank <= p2.rank) {
    if (p1.rank == p2.rank) {
      p2.rank++;
    }
    p1.parent = p2;
    p1.weight = -weight + w1 - w2;
  } else {
    p2.parent = p1;
    p2.weight = weight - w1 + w2;
  }
};

WeightedDisjointSet.prototype.find = function (val) {
  let cur = this.m[val];
  if (cur.parent != cur) {
    const root = this.find(cur.parent.val);
    cur.weight += cur.parent.weight;
    cur.parent = root;
  }
  return cur.parent;
};

WeightedDisjointSet.prototype.diff = function (val1, val2) {
  const p1 = this.find(val1);
  const p2 = this.find(val2);
  if (p1 != p2) {
    return null;
  }
  return this.weight(val2) - this.weight(val1);
};

WeightedDisjointSet.prototype.weight = function (val) {
  let weight = 0;
  let cur = this.m[val];
  while (cur.parent != cur) {
    weight += cur.weight;
    cur = cur.parent;
  }
  return weight;
};

let input = require("fs").readFileSync("/dev/stdin", "utf8");
const lines = input.trim().split("\n");
let n, m, d;

try {
  for (let i = 0; i < lines.length; i++) {
    if (i === 0) {
      [n, m] = lines[i].split(" ");
      d = new WeightedDisjointSet();
      for (let i = 0; i < n; i++) {
        d.add(i);
      }
    } else {
      const [x, y, w] = lines[i].split(" ").map((v) => parseInt(v));
      d.merge(x - 1, y - 1, w);
    }
  }
} catch (err) {
  console.log("No");
  return;
}
console.log("Yes");
//  [typescript]
const main = (input) => {
  input = input.split('\n');
  const X = parseInt(input[0], 10);
  const A = parseInt(input[1], 10);
  const B = parseInt(input[2], 10);
  
  console.log((X-A)/B);
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
x=int(input())
r=int(x**0.5)
a=1
for b in range(r+1):
    for p in range(10):
        if b**p <=x :
            a=max(a,b**p)
        else:
            break
print(a)
//  [python]
X = int(input())
upper = int(X**0.5//1)+1
max = 0
for x in range(1,upper):
  for i in range(9):
    if max < x**(i+1) <= X:
      max = x ** (i+1)
print(max)
//  [python]
x=int(input())
i,j=2,1
ans=[]
if x==1:
    print(1)
    quit()
while True:
    j+=1
    if i**j>x:
        i+=1
        j=2
        if i**j>x:
            break
    ans.append(i**j)
print(max(ans))
//  [python]
x=int(input())
res=0
for b in range(x):
    for p in range(2,x):
        if res<(b**p)<=x:
            res=b**p
        elif b**p>x:
            break
print(res)
//  [python]
x = int(input())
ans = 0
for i in range(x+1):
    for j in range(2,x+1):
        if i**j <=x:
            ans = max(ans,i**j)
print(ans)
//  [python]
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
num = []
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

x = k()

for i in range(x+1):
    if i**2<=x:
        ans = i

print(ans**2)
//  [java]
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		int X = Integer.parseInt(in.readLine());
		List<Integer> list = new ArrayList<>();
		list.add(1);
		for (int i = 2; i <= 33; ++i) {
			int base = i;
			int val = i * i;
			while (val <= X) {
				list.add(val);
				val *= base;
			}
		}
		Collections.sort(list);
		Collections.reverse(list);
		for (int i = 0; i < list.size(); ++i) {
			if (list.get(i) <= X) {
				System.out.println(list.get(i));
				return;
			}
		}
	}

	void calc() {
	}

	void showResult() {
	}
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    String s;
    String sl[];
    s = r.readLine();
    sl = s.split(" ");
    
    int v[] = new int[1234];

    int x = Integer.parseInt(sl[0]);
    
    v[1] = 1;
    for(int i = 2; i <= 1000; i++)
    {
      for(int j = i * i; j <= 1000; j *= i)
      {
        v[j] = 1;
      }
    }
    
    for(int i = x; ; i--)
    {
      if(v[i] == 1)
      {
        System.out.println(i);
        System.exit(0);
      }
    }

  }

}
//  [java]
import java.util.*;
import java.io.*;

public class Main {
		public static void main(String[] args) throws IOException {
		
		// 入出力高速化 java.io.* とthrows IOExceptionを忘れずに
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int[] B = new int[32];
		for(int b=0; b<32; b++){
			B[b]=(b+1)*(b+1);
		}
		
		int X = Integer.parseInt(br.readLine());
		int ans = 0;
		for(int x=0; x<32; x++){
			if(B[x]>X){
				ans = B[x-1];
				break;
			}
		}
		
        System.out.println(ans);
    }
}
//  [java]
import java.util.*;
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int k = (int)Math.sqrt(sc.nextDouble());
		System.out.println(k*k);
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		double x = sc.nextDouble();
		int ans = 1;
		boolean c = false;
		for(int i = (int)x; i > 0; i--) {
			if(c) break;
			for(int j = 2; j < i; j++) {
				if(Math.log(i)%Math.log(j) == 0) {
					ans = (int)i;
					c = true;
					break;
				}
			}
		}
		System.out.println(ans);
	}

	static class FastScanner {
		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;
	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

	    public long nextLong() {
	        return Long.parseLong(next());
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }

	    public double nextDouble() {
	         return Double.parseDouble(next());
	     }

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }
	}
}
//  [cpp]
#include <stdio.h>
#include <string.h>

int main(void) {
	int table[1001];
	int x;
	scanf("%d", &x);
	
	memset(table, 0, sizeof(int) * 1001);
	table[1] = 1;
	for (int i = 2; i <= 1000; i++) {
		if (table[i] == 0) {
			for (int j = i * i; j <= 1000; j *= i) {
				table[j] = 1;
			}
		}
	}

	for (int i = x; i >= 1; i--) {
		if (table[i] == 1) {
			printf("%d\n", i);
			return 0;
		}
	}

	return 0;
}
//  [cpp]
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
using namespace std;
int main()
{
	int x;
	cin >> x;
	int ma = 1;
	for (int i = 2; i < x; i++) {
		int a = i*i;
		while (a <= x) {

			ma = max(ma, a);
			a = a * i;
		}
	}
	cout << ma << endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>  

using namespace std;

#define int long long
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define INF 1e9
#define LINF 1e18

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;
typedef pair<P, P> PP;

const int MOD = 1e9 + 7;
const int dy[]={0, 0, 1, -1};
const int dx[]={1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int X;
    cin >> X;
    int res = 0;
    FOR(i, 1, X + 1) {
        int latte = i;
        FOR(j, 1, X + 1) {
            latte *= i;
            if(latte <= X) chmax(res, latte);
            else break;
        }
    }
    cout << res << endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(){
  int x;
  cin >> x;
  
  int max = 0, x2 = sqrt(x);
  for (int i=1 ; i<=x2; i++){
    for (int j=2 ; j<=x+1 ; j++){
      max = pow(i, j);
      if (pow(i, j+1) > x)
        break;
    }
  }
  
  cout << max << endl;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;



int main() {
    int x;
    cin >> x;
    int ans = 0;
    for (int i = 1; i <= 33; i++) {
        for (int j = i; j <= x; j *= i) {
            ans = max(ans, j);
            if (j == 1) break;
        }
    }
    cout << ans << endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;



int main() {
    int x;
    cin >> x;
    int ans = 0;
    for (int i = 1; i <= 33; i++) {
        for (int j = i; j <= x; j *= i) {
            ans = max(ans, j);
        }
    }
    cout << ans << endl;
    return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main(void)
{
    int x,a,b=1,p=2,s,max=0,tmp;
    scanf("%d",&x);
    a=sqrt(x);
    while(b<=a){
        s=b;
        while((s<=x)&&(p<=10)){
            s=s*b;
            p++;
        }
        s=s/b;
        if(max<s){
            tmp=max; max=s; s=tmp;
        }
        b++;
        p=2;
    }
    printf("%d\n",max);
    return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main(){
  int x,i,max=1;
  scanf("%d",&x);
  for(i=2;i<=sqrt(x);i++){
    int a=i*i;
    while(a*i<=x)
      a=a*i;
    if(a>max)
      max=a;
  }
  printf("%d\n",max);
  return 0;
}
//  [c]
#include<stdio.h>
int main(void){
	int x,i,n,max=1;
	scanf("%d",&x);
	for(i=2;i*i<=x;i++){
		n=1;
		while(n*i<x){
			n*=i;
		}
		max=max<n?n:max;
	}
	printf("%d",max);
	return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>
int main()
{
    float a,i;
    int n,k=2,lrg,la=1;
    scanf("%d",&n);
    
    a=sqrt(n+1);
  
    for(i=2;i<=a;i++)
    {
        for(k=2;;k++)
        {
        if(pow(i,k)<n){
        lrg=pow(i,k);
                if(lrg>=la)
                la=lrg;
               }
        else
            break;
         }
    }
 
    printf("%d",la);
}
//  [c]
#include <stdio.h>
#include <math.h>

int main()
{
	int n;
	int i = 1, count = 1;
	scanf("%d", &n);

	while (pow(count,2) <= n) {
		i = pow(count, 2);
		count++;
	}


	printf("%d\n", i);

	return 0;
}
//  [javascript]
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}
function Main(input) {
  input = myconv(input,1);
  var set = new Set();
  set.add(1);
  for(var i = 2; i <= Math.sqrt(input); i++){
    var tmp = i;
    while(tmp <= input){
       set.add(tmp);
      tmp *= i;
    }
  }
  while(true){
     if(set.has(input)){
        myout(input);
       return;
     }else{
       input--;
     }
  }
  
}
Main(myin());
//  [javascript]
'use strict'

const main = (input) => {
    const X = parseInt(input)
    let ans = 1
    for(let b = 1; b <= X; b++){
        for(let p = 2; p <= X; p++){
            let pow = Math.pow(b, p)
            if(pow > X) break
            if(pow > ans){
                ans = pow
            }
        }
    }
    console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))
//  [javascript]
var main = function(input) {
  var X = parseInt(input);
  var max = 0;
  var I;
  for(var b=1;b<=X;b++){
    for(var p=2;p<10;p++){
    I = Math.pow(b,p);
      if(X<I){
        break;
      } 
      if(max<I){
      max = I;
      }
    }
  }
  console.log(max);
  return　 0;
}

main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
const main = stdin => {
  const input = stdin.trim().split('\n')
  const [X] = input[0].split(' ').map(x => parseInt(x))

  for (let i = X; i >= 1; i--) {
    if (Math.sqrt(i) % 1 === 0) {
      console.log(i)
      break
    }
  }
}


// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
//  [javascript]
'use strict';
function Main(input) {
	input = parseInt(input.trim());  
	if(input<1){
      return;
    }
  	for(let i = input; i > 0; i--){
    	if(Math.sqrt(i)%1===0){
          console.log('%d',i);
          return;
        }
    }
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';
function Main(input) {
	input = parseInt(input.trim());  
	
  	for(let i = input; i > 0; i--){
    	if(Math.sqrt(i)%1===0){
          console.log('%d',i);
          return;
        }
    }
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	var x int
	fmt.Scan(&x)

	ans := 1
	for i := 2; i*i <= x; i++ {
		for j := 2; ; j++ {
			e := int(math.Pow(float64(i), float64(j)))
			if e <= x {
				ans = max(ans, e)
			} else {
				break
			}
		}
	}
	fmt.Println(ans)
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	var x int
	fmt.Scan(&x)

	result := 1
	for i := 2; i < x; i++ {
		for j := 2; j < x; j++ {
			now := int(math.Pow(float64(i), float64(j)))
			if now > x {
				break
			} else if result < now {
				result = now
			}
		}
	}

	fmt.Println(result)
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for B - Exponential
	var X int
	fmt.Scanf("%d", &X)

	for i := X; 0 < i; i-- {
		temp := math.Sqrt(float64(i))
		if math.Round(temp) == temp {
			fmt.Println(i)
			break
		}
	}
}
//  [go]
package main

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

func solve(sc *scanner, wr *bufio.Writer) {
	x := sc.getInt()

	ans := 1
	for i := 2; i*i <= x; i++ {
		j := i
		for j*i <= x {
			j *= i
		}
		ans = j
	}
	fmt.Fprintln(wr, ans)
}

func main() {
	sc := newScanner()
	wr := bufio.NewWriter(os.Stdout)
	maxBufSize := int(1e8)
	sc.Buffer(make([]byte, 4096), maxBufSize)
	sc.Split(bufio.ScanWords)

	solve(sc, wr)
	wr.Flush()
}

// input ------------------------
type scanner struct {
	*bufio.Scanner
}

func newScanner() *scanner {
	sc := bufio.NewScanner(os.Stdin)
	return &scanner{sc}
}
func (sc *scanner) getInt() int {
	sc.Scan()
	ret, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return ret
}
func (sc *scanner) getInt2() (int, int) {
	return sc.getInt(), sc.getInt()
}
func (sc *scanner) getInt3() (int, int, int) {
	return sc.getInt(), sc.getInt(), sc.getInt()
}
func (sc *scanner) getInt4() (int, int, int, int) {
	return sc.getInt(), sc.getInt(), sc.getInt(), sc.getInt()
}
func (sc *scanner) getInts(n int) []int {
	ret := make([]int, n)
	for i := range ret {
		ret[i] = sc.getInt()
	}
	return ret
}
func (sc *scanner) getString() string {
	sc.Scan()
	return sc.Text()
}
func (sc *scanner) getRunes() []rune {
	return []rune(sc.getString())
}
func (sc *scanner) getFloat() float64 {
	sc.Scan()
	ret, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return ret
}
func (sc *scanner) getFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := range ret {
		ret[i] = sc.getFloat()
	}
	return ret
}

// math ----------------------------
func sum(ns ...int) int {
	var sum int
	for _, n := range ns {
		sum += n
	}
	return sum
}

func max(ns ...int) int {
	max := ns[0]
	for i := 1; i < len(ns); i++ {
		if max < ns[i] {
			max = ns[i]
		}
	}
	return max
}

func min(ns ...int) int {
	min := ns[0]
	for i := 1; i < len(ns); i++ {
		if min > ns[i] {
			min = ns[i]
		}
	}
	return min
}

func pow(a, b int) int {
	ret := 1
	for b > 0 {
		if b&1 > 0 {
			ret = ret * a
		}
		a = a * a
		b >>= 1
	}
	return ret
}
//  [go]
package main

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

func solve(sc *scanner, wr *bufio.Writer) {
	x := sc.getInt()

	var ans int
	for i := 1; i <= x; i++ {
		if i*i > x {
			break
		}
		ans = i * i
	}
	fmt.Fprintln(wr, ans)
}

func main() {
	sc := newScanner()
	wr := bufio.NewWriter(os.Stdout)
	maxBufSize := int(1e8)
	sc.Buffer(make([]byte, 4096), maxBufSize)
	sc.Split(bufio.ScanWords)

	solve(sc, wr)
	wr.Flush()
}

// input ------------------------
type scanner struct {
	*bufio.Scanner
}

func newScanner() *scanner {
	sc := bufio.NewScanner(os.Stdin)
	return &scanner{sc}
}
func (sc *scanner) getInt() int {
	sc.Scan()
	ret, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return ret
}
func (sc *scanner) getInt2() (int, int) {
	return sc.getInt(), sc.getInt()
}
func (sc *scanner) getInt3() (int, int, int) {
	return sc.getInt(), sc.getInt(), sc.getInt()
}
func (sc *scanner) getInt4() (int, int, int, int) {
	return sc.getInt(), sc.getInt(), sc.getInt(), sc.getInt()
}
func (sc *scanner) getInts(n int) []int {
	ret := make([]int, n)
	for i := range ret {
		ret[i] = sc.getInt()
	}
	return ret
}
func (sc *scanner) getString() string {
	sc.Scan()
	return sc.Text()
}
func (sc *scanner) getRunes() []rune {
	return []rune(sc.getString())
}
func (sc *scanner) getFloat() float64 {
	sc.Scan()
	ret, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return ret
}
func (sc *scanner) getFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := range ret {
		ret[i] = sc.getFloat()
	}
	return ret
}

// math ----------------------------
func sum(ns ...int) int {
	var sum int
	for _, n := range ns {
		sum += n
	}
	return sum
}

func max(ns ...int) int {
	max := ns[0]
	for i := 1; i < len(ns); i++ {
		if max < ns[i] {
			max = ns[i]
		}
	}
	return max
}

func min(ns ...int) int {
	min := ns[0]
	for i := 1; i < len(ns); i++ {
		if min > ns[i] {
			min = ns[i]
		}
	}
	return min
}

func pow(a, b int) int {
	ret := 1
	for b > 0 {
		if b&1 > 0 {
			ret = ret * a
		}
		a = a * a
		b >>= 1
	}
	return ret
}
//  [ruby]
Dic = [1000, 961, 900, 841, 784, 729, 676, 625, 576, 529, 512, 484, 441, 400, 361, 343, 324, 289, 256, 243, 225, 216, 196, 169, 144, 128, 125, 121, 100, 81, 64, 49, 36, 32, 27, 25, 16, 9, 8, 4, 1]
x = gets.to_i
puts Dic.bsearch{|y| y <= x}
//  [ruby]
X = gets.to_i

x = Math.log(X+0.5)
ans = []
(2..10).each{|i|
  wk = Math.exp(x / i.to_f).floor
  (ans << 1; break) if wk < 2
  ans << wk ** i
}

puts ans.max
//  [ruby]
x = gets.to_i

result = 0

(1 .. 32).each{ |i|
	(2 .. 10).each{ |j|
		temp = i ** j
		if result < temp && temp <= x then
			result = temp
		end
	}
}

puts result
//  [ruby]
X = gets.to_i

max = 0

1.upto(X) do |i|
  2.upto(X) do |j|
    y = i ** j
    break if  X < y
    max = y if max < y
  end
end

puts max
//  [ruby]
require "prime"
x = gets.chomp.to_i
ans = 1

(x+1).times do |i|
    next if i == 0
    res = Prime.prime_division(i)
    ans = ans < i ? i : ans if res.size == 1 && res[0][1] >= 2
end
puts ans
//  [ruby]
x = gets.to_i
ans = nil
(1..32).each do |i|
  if i**2 <= x
    ans = i**2
  else
    puts ans
    exit
  end
end
//  [rust]
#![allow(unused_imports)]

use std::cmp::{max, min};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque};
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let x: usize = input().unwrap();
    let mut ans = 1;
    for b in 2usize..40 {
        let m = (2..).map(|p| b.pow(p)).take_while(|a| *a <= x).last().unwrap_or(1);
        ans = max(ans, m);
    }

    println!("{}", ans);
}

pub fn input<T: FromStr>() -> Result<T, T::Err> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    Ok(buf.trim().parse().ok().unwrap())
}

pub fn input_vec<T: FromStr>() -> Result<Vec<T>, T::Err> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    Ok(buf
        .trim()
        .split_whitespace()
        .map(|x| x.parse().ok().unwrap())
        .collect::<Vec<_>>())
}

pub fn input_two<T: FromStr, U: FromStr>() -> (T, U) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse::<T>().ok().unwrap(),
        s[1].parse::<U>().ok().unwrap(),
    )
}

pub fn input_three<T: FromStr, U: FromStr, V: FromStr>() -> (T, U, V) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse::<T>().ok().unwrap(),
        s[1].parse::<U>().ok().unwrap(),
        s[2].parse::<V>().ok().unwrap(),
    )
}

pub fn input_four<T: FromStr, U: FromStr, V: FromStr, W: FromStr>() -> (T, U, V, W) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    let s: Vec<&str> = buf.split_whitespace().collect();
    (
        s[0].parse().ok().unwrap(),
        s[1].parse().ok().unwrap(),
        s[2].parse().ok().unwrap(),
        s[3].parse().ok().unwrap(),
    )
}
//  [rust]
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")
}

fn main() {
    let x: usize = read();
    let mut maxv = 0;
    if x <= 3 {
        println!("{}", 1);
        return;
    }

    for i in 2..x {
        let mut imut = i;

        while imut * i <= x {
            imut *= i;
        }

        if maxv < imut && i != imut {
            maxv = imut;
        }
    }
    println!("{}", maxv);
}
//  [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 v:Vec<i32> = procon_read();
	let x = v[0];
	let mut a:Vec<i32> = Vec::new();
	let mut maxi = 1;
	a.push(1);
	a.push(1);
	for i in 2..x {
		for j in 2.. {
			if i.pow(j) > x {
				break;
			}
			if i.pow(j) > maxi {
				maxi = i.pow(j);
				a.pop();
				a.pop();
				a.push(j as i32);
				a.push(i);
			}
		}
	}
	let b = a.pop().unwrap();
	let p = a.pop().unwrap();
	println!("{}", b.pow(p as u32));
}
//  [rust]
use proconio::{fastout, input};
use std::collections::HashMap;

#[fastout]
fn main() {
    input!(x: usize);
    if x == 1 {
        println!("1");
        return;
    }

    let mut b_v = vec![false; 1001];

    for v in 1..x {
        for i in 2..1000f32.sqrt() as u32 {
            let buff = v.pow(i) as usize;
            if buff > 1000 {
                break;
            }
            b_v[buff] = true;
        }
    }

    for i in (0..x).rev() {
        if b_v[i] {
            println!("{}", i);
            return;
        }
    }
}

mod era {
    #[cfg(test)]
    mod tests {

        use super::sieve;

        #[test]
        fn era() {
            assert_eq!(sieve(100000000).len(), 5761455);
        }
    }

    /// エラトステネスの篩
    /// 少し早い
    /// 引数までの素数を返す
    pub fn sieve(n: usize) -> Vec<usize> {
        let mut ps: Vec<usize> = vec![2];
        let mut xs: Vec<bool> = vec![true; n / 2];

        let mut x = 3;
        while x * x <= n {
            let mut y = (x - 3) / 2;
            if xs[y] {
                ps.push(x);
                y += x;
                for v in xs.iter_mut().skip(y).step_by(x) {
                    *v = false;
                }
            }
            x += 2;
        }
        for v in (x..n + 1).step_by(2).filter(|x| xs[(*x - 3) / 2] == true) {
            ps.push(v);
        }
        ps
    }
}

fn trial_division(mut n: usize) -> HashMap<usize, usize> {
    let mut primes = HashMap::new();
    let mut i = 2;

    //  n を root n 以下の整数で割り切れるまで割っていく
    while i * i <= n {
        while n % i == 0 {
            n /= i;
            if primes.contains_key(&i) {
                let x = primes.get_mut(&i).unwrap();
                *x += 1;
            } else {
                primes.insert(i, 1);
            }
        }
        i += 1;
    }

    // 最後にnが素数になっている場合はそれ自身も素因数に含めて終了
    if n > 1 {
        if primes.contains_key(&n) {
            let x = primes.get_mut(&n).unwrap();
            *x += 1;
        } else {
            primes.insert(n, 1);
        }
    }
    primes
}
//  [rust]
use proconio::{fastout, input};
use std::collections::HashMap;

#[fastout]
fn main() {
    input!(x: usize);
    if x == 1 {
        println!("{}", 1);
        return;
    }
    let aaa = era::sieve(1001);

    for i in (0..x + 1).rev() {
        let m = trial_division(i);
        let mut is_ok = true;
        for v in m.iter() {
            if v.1 % 2 != 0 || (*v.1 == 1 && aaa.contains(v.0) && m.len() == 1) {
                is_ok = false;
                break;
            }
        }

        if is_ok {
            println!("{}", i);
            return;
        }
    }
}

mod era {
    #[cfg(test)]
    mod tests {

        use super::sieve;

        #[test]
        fn era() {
            assert_eq!(sieve(100000000).len(), 5761455);
        }
    }

    /// エラトステネスの篩
    /// 少し早い
    /// 引数までの素数を返す
    pub fn sieve(n: usize) -> Vec<usize> {
        let mut ps: Vec<usize> = vec![2];
        let mut xs: Vec<bool> = vec![true; n / 2];

        let mut x = 3;
        while x * x <= n {
            let mut y = (x - 3) / 2;
            if xs[y] {
                ps.push(x);
                y += x;
                for v in xs.iter_mut().skip(y).step_by(x) {
                    *v = false;
                }
            }
            x += 2;
        }
        for v in (x..n + 1).step_by(2).filter(|x| xs[(*x - 3) / 2] == true) {
            ps.push(v);
        }
        ps
    }
}

fn trial_division(mut n: usize) -> HashMap<usize, usize> {
    let mut primes = HashMap::new();
    let mut i = 2;

    //  n を root n 以下の整数で割り切れるまで割っていく
    while i * i <= n {
        while n % i == 0 {
            n /= i;
            if primes.contains_key(&i) {
                let x = primes.get_mut(&i).unwrap();
                *x += 1;
            } else {
                primes.insert(i, 1);
            }
        }
        i += 1;
    }

    // 最後にnが素数になっている場合はそれ自身も素因数に含めて終了
    if n > 1 {
        if primes.contains_key(&n) {
            let x = primes.get_mut(&n).unwrap();
            *x += 1;
        } else {
            primes.insert(n, 1);
        }
    }
    primes
}
//  [swift]
import Foundation

let x = Int(readLine()!)!
var ans = 0
for i in 2...31 {
  for j in 2...9 {
    let p = pow(Double(i), Double(j))
    if Int(p) <= x { ans = max(Int(p), ans) }
  }
}
print(x < 4 ? 1 : ans)
//  [swift]
//
//  main.swift
//  AtCoderSwift
//
//  Created by burita083 on 2020/08/25.
//  Copyright © 2020 burita083. All rights reserved.
//

import Foundation
func readInt() -> Int {
    return Int(readLine()!)!
}
 
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
func readTwoInts() -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: " ").map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

func abc080_b() {
    let N = readLine()!
    let sum = N.map { Int(String($0))! }.reduce(0, +)
    print(Int(N)! % sum == 0 ? "Yes" : "No")
}

//abc080_b()

func abc078_b() {
    let input = readInts()
    var X = input[0]
    let Y = input[1]
    let Z = input[2]
    var ans = 0
    X -= Y+Z*2
    ans += 1
    ans += X/(Y+Z)
    
    print(ans)
}

func abc085_b() {
    let N = readInt()
    var l: [Int] = []
    for _ in 0..<N {
        let d = readInt()
        l.append(d)
    }
    print(l.reduce([], { $0.contains($1) ? $0 : $0 + [$1] }).count)
}

func isSquare(n: Double) -> Bool {
    let sqrt = floor(n.squareRoot())
    return sqrt * sqrt == n
}

func abc077_b() {
    let N = readInt()
    for n in (1...N).reversed() {
        if isSquare(n: Double(n)) {
            print(n)
            return
        }
    }
}

func abc020_b () {
    let inputs = readInts()
    print(Int(String(inputs[0]) + String(inputs[1]))! * 2)
}

func abc073_b () {
    var ans = 0
    let N = readInt()
    for _ in 0..<N {
        let inputs = readInts()
        ans += inputs[1] - inputs[0] + 1
    }
    print(ans)
}

func abc026_b () {
    var evens: [Int] = []
    var odds: [Int] = []
    var all: [Int] = []
    let N = readInt()
    for _ in 0..<N {
        let R = readInt()
        all.append(R)
    }

    for (i, e) in all.sorted(by: >).enumerated() {
        if i % 2 == 0 {
            evens.append(e)
        } else {
            odds.append(e)
        }
    }
    let ans = evens.map { $0 * $0 }.reduce(0, +) - odds.map { $0 * $0 }.reduce(0, +)
    print(Double(ans) * Double.pi)
}

extension StringProtocol {
    var firstUppercased: String {
        return prefix(1).uppercased()  + self.lowercased().dropFirst()
    }
}

func abc012_b () {
    print(readLine()!.firstUppercased)

}

func abc007_b () {
    print(readLine()! == "a" ? -1 : "a")
}

func abc028_b () {
    let S = readLine()!
    let A = String(S.filter { $0 == "A" }.count)
    let B = String(S.filter { $0 == "B" }.count)
    let C = String(S.filter { $0 == "C" }.count)
    let D = String(S.filter { $0 == "D" }.count)
    let E = String(S.filter { $0 == "E" }.count)
    let F = String(S.filter { $0 == "F" }.count)
    print(A + " " + B + " " + C + " " + D + " " + E + " " + F)
}

func abc097_b () {
    let x = Double(Int(readLine()!)!)
    var ans: Double = 1
    for b in 2..<32 {
        var p: Double = 2
        while pow(Double(b), p) <= x {
            ans = max(ans, pow(Double(b), p))
            p += 1
        }
    }
    print(Int(ans))
}


abc097_b()
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let X = readInt()!
var ans = 0
loop: for b in 1..<32 {
    for p in 2..<10 {
        let exp = exponentiate(b, p)
        if exp == X {
            ans = exp
            break loop
        } else if exp < X {
            ans = max(exp, ans)
        } else {
            break
        }
    }
}
print(ans)
//  [swift]
//
//  main.swift
//  AtCoderSwift
//
//  Created by burita083 on 2020/08/25.
//  Copyright © 2020 burita083. All rights reserved.
//

import Foundation
func readInt() -> Int {
    return Int(readLine()!)!
}
 
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
func readTwoInts() -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: " ").map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

func abc080_b() {
    let N = readLine()!
    let sum = N.map { Int(String($0))! }.reduce(0, +)
    print(Int(N)! % sum == 0 ? "Yes" : "No")
}

//abc080_b()

func abc078_b() {
    let input = readInts()
    var X = input[0]
    let Y = input[1]
    let Z = input[2]
    var ans = 0
    X -= Y+Z*2
    ans += 1
    ans += X/(Y+Z)
    
    print(ans)
}

func abc085_b() {
    let N = readInt()
    var l: [Int] = []
    for _ in 0..<N {
        let d = readInt()
        l.append(d)
    }
    print(l.reduce([], { $0.contains($1) ? $0 : $0 + [$1] }).count)
}

func isSquare(n: Double) -> Bool {
    let sqrt = floor(n.squareRoot())
    return sqrt * sqrt == n
}

func abc077_b() {
    let N = readInt()
    for n in (1...N).reversed() {
        if isSquare(n: Double(n)) {
            print(n)
            return
        }
    }
}

func abc020_b () {
    let inputs = readInts()
    print(Int(String(inputs[0]) + String(inputs[1]))! * 2)
}

func abc073_b () {
    var ans = 0
    let N = readInt()
    for _ in 0..<N {
        let inputs = readInts()
        ans += inputs[1] - inputs[0] + 1
    }
    print(ans)
}

func abc026_b () {
    var evens: [Int] = []
    var odds: [Int] = []
    var all: [Int] = []
    let N = readInt()
    for _ in 0..<N {
        let R = readInt()
        all.append(R)
    }

    for (i, e) in all.sorted(by: >).enumerated() {
        if i % 2 == 0 {
            evens.append(e)
        } else {
            odds.append(e)
        }
    }
    let ans = evens.map { $0 * $0 }.reduce(0, +) - odds.map { $0 * $0 }.reduce(0, +)
    print(Double(ans) * Double.pi)
}

extension StringProtocol {
    var firstUppercased: String {
        return prefix(1).uppercased()  + self.lowercased().dropFirst()
    }
}

func abc012_b () {
    print(readLine()!.firstUppercased)

}

func abc007_b () {
    print(readLine()! == "a" ? -1 : "a")
}

func abc028_b () {
    let S = readLine()!
    let A = String(S.filter { $0 == "A" }.count)
    let B = String(S.filter { $0 == "B" }.count)
    let C = String(S.filter { $0 == "C" }.count)
    let D = String(S.filter { $0 == "D" }.count)
    let E = String(S.filter { $0 == "E" }.count)
    let F = String(S.filter { $0 == "F" }.count)
    print(A + " " + B + " " + C + " " + D + " " + E + " " + F)
}

func abc097_b () {
    let x = Double(Int(readLine()!)!)
    var ans: Double = 1
    for b in 2..<32 {
        var p: Double = 2
        while pow(Double(b), p) <= x {
            ans = max(ans, pow(Double(b), p))
            p += 1
        }
    }
    print(ans)
}


abc097_b()
//  [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()
  for(let i=n;i>0;i--){
    for(let j=2;j**2<=n;j++){
      for(let k=2;j**k<=n;k++){
        if(j**k==i){
          to(i)
          return
        }
      }
    }
  }
  to(1)
}
main()
//  [typescript]
function main(input) {
  const x = Number(input.trim());
  let result = 0;
  for (let b = 1; b <= x; b++) {
    for (let p = 2; p <= x; p++) {
        const num = b**p;
    	if (num <= x && result < num) result = num;
      	if (x < num) break;
    }
  }
  if (x === 1) result = 1;
  console.log(result);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import * as fs from 'fs'
const inputs = fs.readFileSync('/dev/stdin', 'utf8').split(/\r?\n/)
const [x] = inputs.shift()!.split(' ').map(s => parseInt(s, 10))
const ok = new Array<boolean>(x).fill(false)

ok[0] = true
for (let i = 2; i <= x; i++) {
    if (!ok[i-1]) {
        for (let j = i*i; j <= x; j*=i) {
            ok[j-1] = true
        }
    }
}
console.log(x - ok.reverse().findIndex(o => o))
//  [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()
  for(let i=n;i>0;i--){
    for(let j=2;j**2<n;j++){
      for(let k=2;j**k<n;k++){
        if(j**k==i){
          to(i)
          return
        }
      }
    }
  }
  to(1)
}
main()
//  [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()
  for(let i=n;i>0;i--){
    if(Number.isInteger(Math.sqrt(i))){
      to(i)
      return
    }
  }
}
main()
//  [typescript]
import { ifError } from "assert";

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()
  for(let i=n;i>0;i--){
    if(Number.isInteger(Math.sqrt(i))){
      to(i)
      return
    }
  }
}
main()
//  [python]
# -*- coding: utf-8 -*-

N = int(input())
S = input()
K = int(input())
ans = [s if s == S[K-1] else '*' for s in S]

print(''.join(ans))
//  [python]
N = input()
S = input()
K = int(input())

target = S[K-1]
result = ""
for i in S:
    if target == i:
        result += i
    else:
        result += '*'

print(result)
//  [python]
N=int(input())
S=str(input())
K=int(input())
target = S[K-1]
arr = ''
 
for i in range(N):
	if S[i]==target:
		arr+=target
	else:
		arr+=('*')
 
print(arr)
//  [python]
N = int(input())
S = list(input())
K = int(input())
for i in S:
  if s[i - 1] != s[k]:
    s[i - i] = "*"
print(S)
//  [python]
s = input()
k = int(input())
print(s.replace(s[k-1],'*'))
//  [python]
input()
n = int(input())
s = input()
print(s.replace(s[n-1],'*'))