#include #include #include #include #include "queue" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MOD1 1000000007 inline void inp( long long int &n ){n=0;int ch=getchar();int sign=1;while( ch < '0' || ch > '9' ){if(ch=='-')sign=-1; ch=getchar();}while( ch >= '0' && ch <= '9' )n = (n<<3)+(n<<1) + ch-'0', ch=getchar();n=n*sign;} #define pi acos(-1) #define pii pair #define vii vector #define ll long long int #define loop(i,n) for(ll i=0;i (b) ? (a) : (b) #define ABS(a) (a) > 0 ? (a) : -(a) #define rep1(i,a,n) for(i=a;i<(n);i++) #define pb push_back #define ff first #define ss second #define mp make_pair #define OUT_RT cerr << (float(clock()) / CLOCKS_PER_SEC) << endl #define EPS 1e-9 #define ld long double typedef std::tuple query; using namespace std; //JAI SHREE KRISHNA // Find the holy grail in an adventure frought with danger // The bigger the occasion, the better the response. // Never giving in, fighting to the end // Look at the limits // Check if it is binary search // Code till the end ofcontest int main() { ios::sync_with_stdio(false); cin.tie(0); vectorv1; loop(i, 26) { ll x; cin>>x; v1.pb(x); } ll max1 = -1; string z; cin>>z; ll y = z.length(); loop(i, z.length()) { max1 = max(max1,v1[z[i]-'a']); } cout<