// Problem#: 1394
// Submission#: 3810734
// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/
// All Copyright reserved by Informatic Lab of Sun Yat-sen University
#include<iostream>
#include <cmath>
using namespace std;
int main()
{
int B,n;
while(cin >> B >> n&&(B!=0&&n!=0))
{
double s=1.0/n;
double a=pow(B,s);
int b=a;
int c=pow(b,n);
int d=pow(b+1,n);
if((B-c)>=(d-B))cout << b+1 << endl;
else cout << b << endl;
}
}