#include #define rep(i,n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair; int main(){ int n; cin>>n; vector fsf(3); rep(i, 3) cin>>fsf[i]; vector sn(n); rep(i, n){ string s; cin>>s; sn[i]=s.size(); } vector dp(n+1, 1); for(int k : fsf){ int r=0, c=0; rep(i, n){ for(; r