#include #include #include #include #include //#include using namespace std; using namespace atcoder; #define ll long long #define Pll pair #define INF 1000000000000000000 ll min(ll x,ll y){ if(x>y)return y; return x; } signed main(){ ll N,M,K,ans=INF; cin>>N>>M; vector A(N); vector B(M); vectorr(2); vectorm={N,M}; for(ll i=0;i>A.at(i); for(ll i=0;i>B.at(i); for(ll i=0;i