#include #include using namespace std; long long vys,a,b,c,k,zv,x,p,posun,sp; map m; void ries2() { if ((b%c)%zv==0) { p=(b%c)/zv*sp; p+=(b-x)/c; printf("%lld\n",p); } else printf("FOREVER\n"); } int main() { while (scanf("%lld %lld %lld %lld",&a,&b,&c,&k)!=EOF) { if (!a && !b && !c && !k) return 0; if (c==0) { if (a==b) printf("0\n"); else printf("FOREVER\n"); continue; } posun=1ll<