#include <iostream>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
if (a % c == 0 && b % c == 0)
cout << "Fractia " << a << '/' << b << " se simplifica prin " << c;
else
cout << "Fractia " << a << '/' << b << " nu se simplifica prin " << c;
}