#include<bits/stdc++.h>
using namespace std;
double n,d,S,T,H;
int main()
{
cin>>n>>d>>S>>T>>H;
for(int i = 1;i <= n;i++)
{
double s,t,h;
cin>>s>>t>>h;
if(abs(h-H)>d)cout<<"No\n";//高度差大于d,不可能看见
else if(s==S&&t==T)cout<<"Always\n";//起点和终点一样,相当于同一条航线,全程都能看到
else if(s<S&&t<T||s>S&&t>T)cout<<"No\n";//追及,全程落后或全程领先,不可能看见
else
{
double x = (s-S)/(T-S+s-t);//相遇时间点
cout<<S+x*(T-S)<<"\n";
}
}
return 0;
}