#include <iostream>
#include <stdlib.h>
#include <givaro/givgfq.h>
#include <givaro/givpoly1factor.h>
#include <givaro/givtimer.h>
int main(
int argc,
char** argv)
{
if (argc > 1)
else
std::cin >> MOD;
unsigned long expo = 1;
if (argc > 2) expo = (unsigned long)atoi(argv[2]);
Polys P;
FD.read( cin, P );
std::vector<Polys> Lf;
std::vector<unsigned long> Le;
FD.write( cout, P ) << " is 1";
std::vector<unsigned long>::const_iterator e = Le.begin();
for(std::vector<Polys>::const_iterator i = Lf.begin(); i != Lf.end(); ++i, ++e) {
FD.write(cout << " * (", *i) << ")";
if (*e > 1) cout << "^" << *e;
}
std::cout << std::endl;
std::cerr << tim << std::endl;
return 0;
}
#if 0
bool f;
FD.gcd(W,FD.diff(D,P),P);
if (FD.degree(d,W) > 0) return 0;
FD.init(Unit,
Degree(1), F.one);
W.copy(Unit);
FD.degree(dP,P);
Degree dPo = (dP/2);
f = 1;
for(
Degree dp = 1; dp <= dPo; ++dp) {
FD.write(cout << "W: ", W) << endl ;
FD.powmod(W, D.copy(W), MOD, P);
FD.write(cout << "W^q: " , W) << endl ;
FD.gcd (G1, FD.sub(D,W,Unit), P) ;
FD.write(cout << "D: " , D) << endl ;
FD.write(cout << "G1: " , G1) << endl ;
if ( FD.degree(d,G1) > 0 ) { f = 0; break; }
}
#endif