#include <cstdio>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <iostream>
#include <stack>
#include <set>
#include <queue>
#define MAX(a,b) (a) > (b)? (a):(b)
#define MIN(a,b) (a) < (b)? (a):(b)
#define mem(a) memset(a,0,sizeof(a))
#define INF 1000000007
#define MAXN 20005
using namespace std; __int64 GCD(__int64 a,__int64 b)
{
return a%b==?b:GCD(b,a%b);
} void gcd(__int64 a,__int64 b,__int64 &x,__int64 &y)
{
if(!b){x=;y=;}
else{gcd(b,a%b,y,x); y-=x*(a/b);}
} int main()
{
__int64 X,Y,M,N,L;
while(~scanf("%I64d %I64d %I64d %I64d %I64d",&X,&Y,&M,&N,&L))
{
__int64 a = (N-M), b = L, c = (X-Y);
__int64 g = GCD(a,b);
if(c%g){ printf("Impossible\n"); continue;}
__int64 x, y;
gcd(a, b, x, y);
x*=(c/g);
if(x>)x%=(b/g);
else x=x%(b/g)+(b/g);
printf("%I64d\n",x);
}
return ;
}