#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define im imag()
#define re real()
#define r(I, N) for(int I=0;I<N;I++)
#define f(I, A, B) for(int I=A;I<B;I++)
#define fd(I, A, B) for(int I=A;I>=B;I--)
#define ite(x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define sz(x) ((int)(x).size())
#define clr(x) memset(x, 0, sizeof(x))

typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
typedef complex<ld> Point;
typedef Point Vector;

const double pi = acos(-1.0);
const double eps = 1e-12;

inline int sgn(double u)
{
      if(u > eps) return 1;
      else if(u < -eps) return -1;
      else return 0;
}

int main()
{
      ios::sync_with_stdio(false);
      double U;
      while (cin >> U)
      {
            if (sgn(U) == 0) break;
            int n, d = 0;
            r(i, 3000000)
            {
                  d++;
                  n = (int)((double)d * pi);
                  if(sgn(fabs((double)(n + 1) / d - pi) - fabs((double)n / d - pi)) < 0) n++;
                  if(fabs((double)n / d - pi) < U) break;
            }
            cout << n << '/' << d << endl;
      }
}