#include #define endl '\n' using namespace std; void f() { freopen("printing.in", "r", stdin); freopen("printing.out", "w", stdout); } void speed() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int n; string s; int a, b, m, d, h; int price[27]; void read() { cin>>n; cin>>s; cin>>a>>b>>m>>d>>h; for(int i=0; i<27; i++) { cin>>price[i]; } } int used[29]; char str[27]; int cnt; int pos[29]; int str_cnt; void separate() { cnt=1; str_cnt=0; for(int i=0; i