#include <cstdio>
#include <cmath>
using namespace std;
int main(){
int s,x1,x2,t1,t2,p,d;
while(~scanf("%d%d%d",&s,&x1,&x2)){
scanf("%d%d",&t1,&t2);
scanf("%d%d",&p,&d);
int tmp1,tmp2;
tmp1 = abs(x2 - x1) * t2;
if(d == 1){
if(p <= x1 && x2 > x1)
tmp2 = (x2 - p) * t1;
else if(x2 > x1)
tmp2 = (s - p + s + x2) * t1;
else if(x2 < x1)
tmp2 = (s - p + s - x2) * t1;
}
else{
if(p >= x1 && x2 < x1)
tmp2 = (p - x2) * t1;
else if(x2 < x1)
tmp2 = (p + s + s - x2) * t1;
else if(x2 > x1)
tmp2 = (p + x2) * t1;
}
if(tmp1 > tmp2)
printf("%d\n",tmp2);
else
printf("%d\n",tmp1);
}
return 0;
}