https://codeforces.com/contest/1968/problem/D
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)
#define oz 998244353
#define N 200010
#define INF 0x3f3f3f3f
typedef long long ll;
#define endl '\n'
const int mod = 1e9 + 7;
//线性贪心求最大值
int n, k, pb, ps;
vector<int> p(N), a(N);
int ma(int x) { // 枚举在跑到所有能跑的位置 并一直待在原地赚钱的最大值
int mx = k * a[x];
int pre = 0;
for (int i = 1; i <= min(n, k); i++) {
pre += a[x];
x = p[x];
mx = max(mx, pre + a[x] * (k - i));
}
return mx;
}
void solve() {
cin >> n >> k >> pb >> ps;
for (int i = 1; i <= n; i ++) cin >> p[i];
for (int i = 1; i <= n; i ++) cin >> a[i];
int res1 = ma(pb);
int res2 = ma(ps);
if (res1 > res2)cout << "Bodya" << endl;
else if (res1 == res2)cout << "Draw" << endl;
else cout << "Sasha" << endl;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int T = 1;
cin >> T;
while (T --)
solve();
return 0;
}