#include <iostream>
using namespace std;
int main()
{
int h, M;
cin >> h >> M;
for (int i = 1; i <= M; i ++ )
{
if (-6 * i * i * i * i + h * i * i * i + 2 * i * i + i <= 0)
{
cout << "The balloon first touches ground at hour:\n" << i;
return 0;
}
}
cout << "The balloon does not touch ground in the given time.";
return 0;
}