#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int h,w;
    cin>>h>>w;
    vector<string> a(h);
    vector<vector<int>> dp(h,vector<int>(w,0));
    for(int i=0;i<h;i++)
        cin>>a[i];
    for(int i=h-2;i>=0;i--){
        if((i+w-1)&1)
            dp[i][w-1] = dp[i+1][w-1] - (a[i+1][w-1]=='+'?1:-1);
        else
            dp[i][w-1] = dp[i+1][w-1] + (a[i+1][w-1]=='+'?1:-1);
    }
    for(int j=w-2;j>=0;j--){
        if((h-1+j)&1)
            dp[h-1][j] = dp[h-1][j+1] - (a[h-1][j+1]=='+'?1:-1);
        else
            dp[h-1][j] = dp[h-1][j+1] + (a[h-1][j+1]=='+'?1:-1);
    }
    for(int i=h-2;i>=0;i--){
        for(int j=w-2;j>=0;j--){
        if((i+j)&1)
            dp[i][j] = min(dp[i+1][j] - (a[i+1][j]=='+'?1:-1),dp[i][j+1] - (a[i][j+1]=='+'?1:-1));
        else
            dp[i][j] = max(dp[i+1][j] + (a[i+1][j]=='+'?1:-1),dp[i][j+1] + (a[i][j+1]=='+'?1:-1));
        }
    }
    if(dp[0][0]>0)
        cout<<"Takahashi"<<endl;
    else if(dp[0][0]<0)
        cout<<"Aoki"<<endl;
    else 
        cout<<"Draw"<<endl;
    return 0;
}
#include <bits/stdc++.h>


using namespace std;
#define ll long long int
#define maxn 5005


int main()
{
 int n,m;
 cin>>n>>m;
 vector<int> h(n),w(m);
 for(int i=0;i<n;i++){
    cin>>h[i];
 }
 for(int i=0;i<m;i++){
    cin>>w[i];
 }
 sort(h.begin(),h.end());
 ll pref[n]={0};
 pref[0]=-h[0];
 for(int i=1;i<n;i++){
    if(i%2){
        pref[i]=pref[i-1]+h[i];
    }
    else{
        pref[i]=pref[i-1]-h[i];
    }
 }
 ll suff[n+1]={0};

 for(int i=n-1;i>=0;i--){
    if(i%2){
        suff[i]=suff[i+1]+h[i];
    }
    else{
        suff[i]=suff[i+1]-h[i];
    }
 }

 ll ans=1e18;
 for(int i=0;i<m;i++){
    ll tans=0;
    auto ind=upper_bound(h.begin(),h.end(),w[i]);
    int ind1=upper_bound(h.begin(),h.end(),w[i])-h.begin();
    ind1--;
    if(ind==h.end()){
        if(w[i]<=h[0]){
       tans-=w[i];
       tans-=suff[0];
        }
        else{
            tans+=pref[n-1];
            tans+=w[i];
        }
    }
    else{
    tans=pref[ind1];
   // cout<<ind1<<" "<<pref[ind1]<<" "<<suff[ind1+1]<<endl;
    ind1++;
    if(ind1%2){
        tans+=w[i];
        tans-=suff[ind1];
    }
    else{
        tans-=w[i];
        tans-=suff[ind1];
    }
    }
    ans=min(ans,tans);
    //cout<<tans<<endl;
 }
 cout<<ans<<endl;
}

