#include <stdio.h>#include <stdlib.h>#include <iostream>#include <string.h>#include <math.h>using namespace std;int main(void){double b,n,temp;while( cin >> b >> n && b && n ){temp = pow(b,1/n);int x = (int)temp;int y = (int)(temp+0.5);if( b - pow(x,n) > pow(y,n) - b )cout << y << endl;elsecout << x << endl;}return 0;}


