#include <bits/stdc++.h>
using namespace std;
using ll = long long;
static const ll INF = (1LL<<60);
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
ll n, k;
int PB, PS;
cin >> n >> k >> PB >> PS;
PB--;
PS--; // convert to 0-based indices
vector<int> perm(n);
for (int i = 0; i < n; i++) {
cin >> perm[i];
perm[i]--; // make it 0-based
}
vector<ll> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
auto best_score = [&](int s) -> ll {
// 1) Find path and detect cycle
vector<int> pos(n, -1), path;
path.reserve(n);
int cur = s;
while (pos[cur] == -1) {
pos[cur] = (int)path.size();
path.push_back(cur);
cur = perm[cur];
}
int t0 = pos[cur]; // index in path where cycle starts
int L = (int)path.size() - t0; // cycle length
// 2) Build prefix sums over the entire path
vector<ll> pre(path.size() + 1, 0LL);
for (int i = 0; i < (int)path.size(); i++) {
pre[i+1] = pre[i] + arr[ path[i] ];
}
// 3) Extract cycle values from path[t0 .. end-1]
vector<ll> cycVals(L), cycPre(L+1, 0LL);
ll maxC = 0;
for (int i = 0; i < L; i++) {
cycVals[i] = arr[ path[t0 + i] ];
cycPre[i+1] = cycPre[i] + cycVals[i];
maxC = max(maxC, cycVals[i]);
}
// 4) If k < t0, we never enter the cycle; we can only walk k steps.
if (k < t0) {
// At turn 0, position = path[0]; at turn 1, path[1], ... up to turn k = path[k].
return pre[k+1];
}
// 5) Otherwise, we walk the entire tail of length t0 first.
ll sumTail = pre[t0];
// 6) We have (k - t0) turns left to move around the cycle (or stay).
ll ans = 0;
ll left = k - t0;
// Try walking j steps into the cycle (0 <= j < L), then stay at cycle-max
for (int j = 0; j < L; j++) {
if ((ll)j > left) break;
// sumTail + sum of the first (j+1) cycle‐nodes + (left - j) * maxC
ll cand = sumTail + cycPre[j+1] + (left - j) * maxC;
ans = max(ans, cand);
}
return ans;
};
ll sb = best_score(PB);
ll ss = best_score(PS);
if (sb > ss) {
cout << "Bodya\n";
} else if (ss > sb) {
cout << "Sasha\n";
} else {
cout << "Draw\n";
}
}
return 0;
}