#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
const ll mod=1e9+7;
const ll N=1e5+2;
ll n,l;
ll a[N],b[N];
vector<ll>va,vb;
queue<pair<ll,ll> >q;
int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	cin >> n >> l;
	for(int i=1; i<=n+1 ;i++){
		if(i!=n+1) cin >> a[i];
		else a[i]=l+1;
		va.push_back(a[i]-a[i-1]-1);
	}
	for(int i=1; i<=n+1 ;i++){
		if(i!=n+1) cin >> b[i];
		else b[i]=l+1;
		vb.push_back(b[i]-b[i-1]-1);
	}
	for(int i=0; i<=n ;i++){
		if(va[i]!=0) q.push({va[i],i});
	}
	q.push({1e18,0});
	ll ans=0;
	for(int i=0; i<=n ;i++){
		if(vb[i]==0) continue;
		ll mn=i;
		ll mx=i;
		while(vb[i]>0){
			auto c=q.front();q.pop();
			vb[i]-=c.fi;
			mn=min(mn,c.se);
			mx=max(mx,c.se);
		}
		ans+=mx-mn;
		//cout << i << ' ' << mn << ' ' << mx << endl;
		if(vb[i]<0) return cout << "-1\n",0;
	}
	cout << ans << '\n';
}
#include <iostream>
#include <fstream>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <algorithm>
#include <stack>
#include <string>
using namespace std;
typedef long long int ll;
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    //GOOD LUCK
    int n;
    cin >> n;
    string ar[n];
    map<string, int> mep;
    for (int i = 0; i < n; i ++) {
        cin >> ar[i];
    }
    sort(ar, ar+n);
    for (int i = 0; i < n; i ++) {
        
        if (ar[i][0] == '!') {
            mep[ar[i].substr(1, ar[i].length()-1)] += 1;
        }
        else {
            mep[ar[i]] *= -1;
        }
    }
    for (pair<string, int> me: mep) {
        if (me.second < 0) {
            cout << me.first << endl;
            return 0;
        }
    }
    cout << "satisfiable" << endl;
    /* CHECK:
    int vs. ll
    array bounds: n+1
    don't get it wrong
    actually read what's here
    */
}