#pragma GCC optimize("O3") #include using namespace std; using ll=long long; using P=pair; template using V=vector; #define fi first #define se second #define all(v) (v).begin(),(v).end() const ll inf=(1e18); //const ll mod=998244353; const ll mod=1000000007; ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;} ll LCM(ll c,ll d){return c/GCD(c,d)*d;} struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout< bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } templatevoid debag(const vector &a){cerr<<"debag :";for(auto v:a)cerr<void print(const vector &a){for(auto v:a)cout<; int main(){ int n,s,t,k; cin>>n>>s>>t>>k; s--;t--; V x(n); for(int i=0;i>x[i]; V> dp(k+1,V

(n+5,P{inf,inf})); ll m; cin>>m; V> g(n); map mp; for(int i=0;i>a>>b>>c; --a;--b; g[a].emplace_back(b,c); mp[{a,b}]=c; } dp[1][s]=P(x[s],-1); priority_queue,greater> pq; pq.emplace(dp[1][s].fi,1,s); while(pq.size()){ auto [v,tim,cur]=pq.top(); pq.pop(); if(dp[tim][cur].fi=inf){ cout<<"Impossible"<<"\n"; return 0; } int cur=t,id=k; V ans; while(cur!=-1){ ans.emplace_back(cur+1); int bfo=cur; cur=dp[id][cur].se; if(cur==-1)break; if(id!=k||dp[id][bfo].fi!=dp[id][cur].fi+x[bfo]+mp[{cur,bfo}]){ id--; } } cout<<"Possible"<<"\n"; cout<