#include<bits/stdc++.h>
#define ll long long

using namespace std;

int binarysearch(ll int*,int,ll int);

int main(){
	int s,b;
	cin>>s>>b;

	ll int a[s];
	for(int i=0;i<s;i++){
		cin>>a[i];
	}

	ll int p[b];
	int q[b];
	for(int i=0;i<b;i++){
		cin>>p[i]>>q[i];
	}

	ll int l[100005]={0};
	for(int i=0;i<b;i++){
		l[p[i]]+=q[i];
	}

	sort(p,p+b);

	ll int s2=0,sum[b],k=1;
	sum[0]=l[p[0]];
	for(int i=1;i<b;i++){
		sum[i]=sum[i-1]+l[p[i]];
	}

	/*map<int,int>mp;
	for(int i=0;i<b;i++){
		mp[i]=p[i];
	}*/

	for(int i=0;i<s;i++){
		int z=binarysearch(p,b,a[i]);
		cout<<sum[z]<<" ";
	}

	return 0;
}

int binarysearch(ll int*a,int b,ll int x){
	int low=0,high=b-1,mid;

	while(high>=low){
		mid=(high+low)/2;

		if(a[mid]==x){
			return mid;
		}

		else if(a[mid]>x){
			high=mid-1;

			if(high<0){
				return 0;
			}

			if(a[high]<x){
				return high;
			}
		}

		else if(a[mid]<x){
			low=mid+1;

			if(low>=b){
				return b-1;
			}

			if(a[low]>x){
				return low-1;
			}
		}
	}
}


#include<bits/stdc++.h>
#define ll long long

using namespace std;

int binarysearch(ll int*,int,ll int);

int main(){
	int s,b;
	cin>>s>>b;

	ll int a[s];
	for(int i=0;i<s;i++){
		cin>>a[i];
	}

	map<ll int,int>m;
	ll int p[b];
	int q[b];
	for(int i=0;i<b;i++){
		cin>>p[i]>>q[i];
		m[p[i]]=q[i];
	}

	sort(p,p+b);

	ll int s2=0,sum[b],k=1;
	sum[0]=m[p[0]];
	for(int i=1;i<b;i++){
		sum[i]=sum[i-1]+m[p[i]];
	}

	/*map<int,int>mp;
	for(int i=0;i<b;i++){
		mp[i]=p[i];
	}*/

	for(int i=0;i<s;i++){
		int z=binarysearch(p,b,a[i]);
		cout<<sum[z]<<" ";
	}

	return 0;
}

int binarysearch(ll int*a,int b,ll int x){
	int low=0,high=b-1,mid;

	while(high>=low){
		mid=(high+low)/2;

		if(a[mid]==x){
			return mid;
		}

		else if(a[mid]>x){
			high=mid-1;

			if(high<0){
				return 0;
			}

			if(a[high]<x){
				return high;
			}
		}

		else if(a[mid]<x){
			low=mid+1;

			if(low>=b){
				return b-1;
			}

			if(a[low]>x){
				return low-1;
			}
		}
	}
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long s, b, c, e, idx;
    vector< long long> a, sum, p, q, ans;
    vector<tuple<long long, long long>> d;
    cin >> s >> b;
    for(int i = 0; i < s; i++)
    {
        cin >> c;
        a.push_back(c);
    }
    sum.assign( b, 0);
    for(int i = 0; i < b; i++)
    {
        cin >> c >> e;
        d.push_back(make_tuple( c, e));
    }
    sort( d.begin(), d.end());
    for(int i = 0; i < b; i++)
    {
        p.push_back(get<0>(d[i]));
        q.push_back(get<1>(d[i]));
        if(i == 0) sum[i] = get<1>(d[i]);
        else sum[i] = sum[i - 1] + get<1>(d[i]);
    }
    ans.assign( s, 0);
    for(int i = 0; i < s; i++)
    {
        auto it = lower_bound( p.begin(), p.end(), a[i]);
        if(it == p.end()) continue;
        else
        {
            idx = it - p.begin();
            if(p[idx] > a[i] && idx > 0)
               ans[i] = sum[idx - 1];
            else if(p[idx] <= a[i])
                ans[i] = sum[idx];
        }
    }
    for(int i = 0; i < s; i++)
        cout << ans[i] << " ";

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long s, b, c, e, idx;
    vector< long long> a, sum, p, q, ans;
    vector<tuple<long long, long long>> d;
    cin >> s >> b;
    for(int i = 0; i < s; i++)
    {
        cin >> c;
        a.push_back(c);
    }
    sum.assign( b, 0);
    for(int i = 0; i < b; i++)
    {
        cin >> c >> e;
        d.push_back(make_tuple( c, e));
    }
    sort( d.begin(), d.end());
    for(int i = 0; i < b; i++)
    {
        p.push_back(get<0>(d[i]));
        q.push_back(get<1>(d[i]));
        if(i == 0) sum[i] = get<1>(d[i]);
        else sum[i] = sum[i - 1] + get<1>(d[i]);
    }
    ans.assign( s, 0);
    for(int i = 0; i < b; i++)
        cout << p[i] << endl;
    for(int i = 0; i < s; i++)
    {
        auto it = lower_bound( p.begin(), p.end(), a[i]);
        if(it == p.end()) continue;
        else
        {
            idx = it - p.begin();
           /// cout <<  idx << " " << *it << " Attc "  << a[i] << endl;
            if(p[idx] > a[i])
                ans[i] = sum[idx - 1];
            else ans[i] = sum[idx];
        }
    }
    for(int i = 0; i < s; i++)
        cout << ans[i] << " ";

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long s, b, c, e, idx, x, y;
    vector< long long> a, sum, p, q, ans;
    map<long long, long long> mp;
    vector<tuple<long long, long long>> d;
    cin >> s >> b;
    for(int i = 0; i < s; i++)
    {
        cin >> c;
        a.push_back(c);
    }
    for(int i = 0; i < b; i++)
    {
        cin >> c >> e;
        d.push_back(make_tuple( c, e));
    }
    sort( d.begin(), d.end());
    for(int i = 0; i < b; i++)
    {
        x = get<0>(d[i]);
        y = get<1>(d[i]);
        if(mp.find(x) == mp.end())
        {
            p.push_back(x);
            q.push_back(y);
            mp[x] = i;
        }
        else
        {
            q[mp[x]] += y;
        }
    }
    sum.assign( q.size(), 0);
    sum[0] = q[0];
    for(int i = 1; i < q.size(); i++)
    {
        sum[i] = sum[i - 1] + q[i];
    }
    ans.assign( s, 0);
    for(int i = 0; i < s; i++)
    {
        auto it = lower_bound( p.begin(), p.end(), a[i]);
        idx = it - p.begin();
        if(idx == p.size() && idx > 0)
        {
            ans[i] = sum[idx - 1];
        }
        else
        {
            if(p[idx] > a[i] && idx > 0)
               ans[i] = sum[idx - 1];
            else if(p[idx] <= a[i])
                ans[i] = sum[idx];
        }
    }
    for(int i = 0; i < s; i++)
        cout << ans[i] << " ";

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long s, b, c, e, idx, x, y;
    vector< long long> a, sum, p, q, ans;
    map<long long, long long> mp;
    vector<tuple<long long, long long>> d;
    cin >> s >> b;
    for(int i = 0; i < s; i++)
    {
        cin >> c;
        a.push_back(c);
    }
    for(int i = 0; i < b; i++)
    {
        cin >> c >> e;
        d.push_back(make_tuple( c, e));
    }
    sort( d.begin(), d.end());
    for(int i = 0; i < b; i++)
    {
        x = get<0>(d[i]);
        y = get<1>(d[i]);
        if(mp.find(x) == mp.end())
        {
            p.push_back(x);
            q.push_back(y);
            mp[x] = p.size() - 1;
        }
        else
        {
            q[mp[x]] += y;
        }
    }
    sum.assign( q.size(), 0);
    sum[0] = q[0];
    for(int i = 1; i < q.size(); i++)
    {
        sum[i] = sum[i - 1] + q[i];
    }
    ans.assign( s, 0);
    for(int i = 0; i < s; i++)
    {
        auto it = lower_bound( p.begin(), p.end(), a[i]);
        idx = it - p.begin();
        if(idx == p.size() && idx > 0)
        {
            ans[i] = sum[idx - 1];
        }
        else
        {
            if(p[idx] > a[i] && idx > 0)
               ans[i] = sum[idx - 1];
            else if(p[idx] == a[i])
                ans[i] = sum[idx];
        }
    }
    for(int i = 0; i < s; i++)
        cout << ans[i] << " ";

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long s, b, c, e, idx;
    vector< long long> a, sum, p, q, ans;
    vector<tuple<long long, long long>> d;
    cin >> s >> b;
    for(int i = 0; i < s; i++)
    {
        cin >> c;
        a.push_back(c);
    }
    sum.assign( b, 0);
    for(int i = 0; i < b; i++)
    {
        cin >> c >> e;
        d.push_back(make_tuple( c, e));
    }
    sort( d.begin(), d.end());
    for(int i = 0; i < b; i++)
    {
        p.push_back(get<0>(d[i]));
        q.push_back(get<1>(d[i]));
        if(i == 0) sum[i] = get<1>(d[i]);
        else sum[i] = sum[i - 1] + get<1>(d[i]);
    }
    ans.assign( s, 0);
    for(int i = 0; i < s; i++)
    {
        auto it = lower_bound( p.begin(), p.end(), a[i]);
        if(it == p.end()) continue;
        else
        {
            idx = it - p.begin();
            ////cout << p[idx] << " Attc "  << a[i] << endl;
            if(p[idx] > a[i])
                ans[i] = sum[idx - 1];
            else ans[i] = sum[idx];
        }
    }
    for(int i = 0; i < s; i++)
        cout << ans[i] << " ";

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long s, b, c, e, idx, x, y;
    vector< long long> a, sum, p, q, ans;
    map<long long, long long> mp;
    vector<tuple<long long, long long>> d;
    cin >> s >> b;
    for(int i = 0; i < s; i++)
    {
        cin >> c;
        a.push_back(c);
    }
    for(int i = 0; i < b; i++)
    {
        cin >> c >> e;
        d.push_back(make_tuple( c, e));
    }
    sort( d.begin(), d.end());
    for(int i = 0; i < b; i++)
    {
        x = get<0>(d[i]);
        y = get<1>(d[i]);
        if(mp.find(x) == mp.end())
        {
            p.push_back(x);
            q.push_back(y);
            mp[x] = i;
        }
        else
        {
            q[mp[x]] += y;
        }
    }
    sum.assign( q.size(), 0);
    sum[0] = q[0];
    for(int i = 1; i < q.size(); i++)
    {
        sum[i] = sum[i - 1] + q[i];
    }
    ans.assign( s, 0);
    for(int i = 0; i < s; i++)
    {
        auto it = lower_bound( p.begin(), p.end(), a[i]);
        if(it == p.end())
        {
            if(p.size() > 0)
               ans[i] = sum[p.size() - 1];
        }
        else
        {
            idx = it - p.begin();
            if(p[idx] > a[i] && idx > 0)
               ans[i] = sum[idx - 1];
            else if(p[idx] <= a[i])
                ans[i] = sum[idx];
        }
    }
    for(int i = 0; i < s; i++)
        cout << ans[i] << " ";

}


/********************code:-(AARJAV CHAUHAN)**************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define pp pop_back
#define in insert
#define ff first
#define ss second
#define  show for(int j=0;j<v.size();j++) cout<<v[j]<<" ";
#define ld long d
#define e endl
#define bc __builtin_popcount
#define MOD 1000000007
#define INT_SIZE 32
ll fast_expo(ll x,ll p)
{if(p==0) return 1;
else if(p%2==0){ ll t=fast_expo(x,p/2)%MOD;return (t*t)%MOD;} else return (x*(fast_expo(x,p-1))%MOD)%MOD;}
int main()
{
    fast;
    int i,j,c;
    string s;
     cin>>s;
     ll ans=1;
     int cnt[64]={0};
     for(i=0;i<64;i++)
     {
         for(j=0;j<64;j++)
            cnt[i&j]++;
     }
     for(i=0;i<s.length();i++)
     {
         if(s[i]>='A'&&s[i]<='Z')
            c=s[i]-'A'+10;
         else if(s[i]>='a'&&s[i]<='z')
            c=s[i]-'a'+36;
         else if(s[i]=='-')
            c=62;
         else if(s[i]>='0'&&s[i]<='9')
            c=s[i]-'0';
         else
            c=63;
         ans=(ans*cnt[c])%MOD;
     }
     cout<<ans;
}


/********************code:-(AARJAV CHAUHAN)**************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define pp pop_back
#define in insert
#define ff first
#define ss second
#define  show for(int j=0;j<v.size();j++) cout<<v[j]<<" ";
#define ld long d
#define e endl
#define bc __builtin_popcount
#define MOD 1000000007
#define INT_SIZE 32
ll fast_expo(ll x,ll p)
{if(p==0) return 1;
else if(p%2==0){ ll t=fast_expo(x,p/2)%MOD;return (t*t)%MOD;} else return (x*(fast_expo(x,p-1))%MOD)%MOD;}
int main()
{
    int i,j,c;
    string s;
     cin>>s;
     ll ans=1;
     int cnt[64]={0};
     for(i=0;i<64;i++)
     {
         for(j=0;j<64;j++)
            cnt[i&j]++;
     }
     for(i=0;i<s.length();i++)
     {
         if(s[i]>='A'&&s[i]<='Z')
            c=s[i]-'A'+10;
         else if(s[i]>='a'&&s[i]<='z')
            c=s[i]-'a'+36;
         else if(s[i]=='-')
            c=61;
         else if(s[i]>='0'&&s[i]<='9')
            c=s[i]-'0';
         else
            c=63;
         ans=(ans*cnt[c])%MOD;
     }
     cout<<ans;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int convert(char c)
{
    if(c >= '0' && c<= '9')
        return c-'0';
    else if(c >= 'A' && c <= 'Z')
        return c - 'A' + 10;
    else if(c >= 'a' && c <= 'z' )
        return c - 'a' + 36;
    else if(c == '-')
        return 62;
    else if(c == '_')
        return 63;
}

int main() {

    ll bit = 63, res = 1;

    ll look[64];
    memset(look, 0, sizeof(look));

    for(int i = 0; i < 64; i++)
    {
        look[i]++;

        for(int j = 0; j < 64; j++)
        {
            if(j != i)
                look[j & i] ++;
        }
    }

    ll PRIME = pow(10, 9) + 7;

    string s;
    cin>>s;

    int n = s.length();

    for(int i = 0; i < n; i++)
    {
        int bit = convert(s[i]);
        res = (res * look[bit]);
    }

    cout<<res;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int convert(char c)
{
    if(c >= '0' && c<= '9')
        return c-'0';
    else if(c >= 'A' && c <= 'Z')
        return c - 'A' + 10;
    else if(c >= 'a' && c <= 'z' )
        return c - 'a' + 36;
    else if(c == '-')
        return 62;
    else if(c == '_')
        return 63;
}

int main() {

    ll bit = 63, res = 1;

    ll look[64];
    memset(look, 0, sizeof(look));

    for(int i = 0; i < 64; i++)
    {
        look[i]++;

        for(int j = 0; j < 64; j++)
        {
            if(j != i)
                look[j & i] ++;
        }
    }

    ll PRIME = pow(10, 9) + 7;

    string s;
    cin>>s;

    int n = s.length();

    for(int i = 0; i < n; i++)
    {
        int bit = convert(s[i]);
        res = (res * look[bit])%PRIME;
    }

    cout<<res;
}


#include <bits/stdc++.h>
using namespace std;

const int OO = 0x3f3f3f3f ,N = 1e2+5 ,mod = 1e9+7 ;
#define read(FILE)  freopen(FILE, "r", stdin);
#define write(FILE) freopen(FILE, "w", stdout);
#define BeatMeIFUCAN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

string str ;
map<char,int> mp ;
map<int,int> cnt ;
long long ans=1;
int main(){
    for(int i=0;i<64;++i){
        if(i<=9)mp[i+'0']=i;
        else if(i<=35)mp[i-10+'A']=i;
        else if(i<=61)mp[i-36+'a']=i;
        else if(i==62)mp['-']=i;
        else mp['_']=i;
    }
    for(int i=0;i<64;++i){
        map<pair<char,char>,bool>vis;
        for(auto&p1:mp)for(auto&p2:mp){
            int x=p1.second&p2.second;
            if(x==i&&vis[{p1.first,p2.first}]==0)vis[{p1.first,p2.first}]=1 ,++cnt[i] ;
        }
    }
    cin>>str;
    for(char go:str) ans=(ans*cnt[mp[go]])%mod;
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int OO = 0x3f3f3f3f ,N = 1e2+5 ,mod = 1e9+7 ;
#define read(FILE)  freopen(FILE, "r", stdin);
#define write(FILE) freopen(FILE, "w", stdout);
#define BeatMeIFUCAN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

string str ;
map<char,int> mp ;
long long ans=1;
int main(){
    for(int i=0;i<64;++i){
        if(i<=9)mp[i+'0']=i;
        else if(i<=35)mp[i-10+'A']=i;
        else if(i<=61)mp[i-36+'a']=i;
        else if(i==62)mp['-']=i;
        else mp['_']=i;
    }
    cin>>str;
    for(char go:str){
        long long cnt=0;
        map<pair<char,char>,bool>vis;
        for(auto&p1:mp)for(auto&p2:mp){
            int x=p1.second&p2.second;
            if(x==mp[go]&&vis[{p1.first,p2.first}]==0)vis[{p1.first,p2.first}]=1 ,++cnt ;
        }
        ans=(ans*cnt)%mod;
    }
    cout<<ans;
    return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#include<algorithm>
using namespace std;

int main() {
#pragma warning(disable : 4996)
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	long long r = 1;

	vector<int> v;

	char c;
	while (cin >> c) {
		if ('0' <= c && c <= '9')
			v.push_back(c - 48);
		else if ('A' <= c && c <= 'Z') {
			v.push_back(c - 55);
		}
		else if ('a' <= c && c <= 'z') {
			v.push_back(c - 61);
		}
		else if (c == '_') {
			v.push_back(c - 32);
		}
		else
			v.push_back(c + 17);

	}

	for (int i = 0; i < v.size(); i++) {
		int p = 0;
		vector<int> v2(6);

		for (int j = 0; j < 6 && v[i] > 0; j++) {
			v2[j] = v[i] % 2;
			v[i] /= 2;
		}

		for (int j = 0; j < 6; j++) {
			if (v2[j] == 0) {
				r *= 3;
				r %= 1000000007;
			}
		}
	}

	cout << r;
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#include<algorithm>
using namespace std;

int main() {
#pragma warning(disable : 4996)
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	long long r = 1;

	vector<int> v;

	char c;
	while (cin >> c) {
		if ('0' <= c && c <= '9')
			v.push_back(c - 48);
		else if ('A' <= c && c <= 'Z') {
			v.push_back(c - 55);
		}
		else if ('a' <= c && c <= 'z') {
			v.push_back(c - 61);
		}
		else if (c == '_') {
			v.push_back(c - 32);
		}
		else
			v.push_back(c + 18);

	}

	for (int i = 0; i < v.size(); i++) {
		int p = 0;
		vector<int> v2(6);

		for (int j = 0; j < 6 && v[i] > 0; j++) {
			v2[j] = v[i] % 2;
			v[i] /= 2;
		}

		int cr = 1;
		for (int j = 0; j < 6; j++) {
			if (v2[j] == 0)
				cr *= 3;
		}

		r *= cr;
		r %= 1000000007;
	}

	cout << r;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007
ll pow_mod(ll a,ll b)
{
  ll ans=1;
  while(b)
  {
   if(b%2)
   ans=(ans*a)%MOD;
   a=(a*a)%MOD;
   b/=2;
  }
  return ans%MOD;
}
int main()
{
    string s;
    cin>>s;
    int n=s.size();
    long long int cnt=0;
    for(int i=0;i<n;i++)
    {   int tk;
        char d=s[i];
        if(d=='-')
            tk=62;
        else if(d=='_')
            tk=63;
        else
        {
            int tkt=s[i]-'0';
                if(tkt>=0 && tkt<=9)
                    tk=tkt;
                 else
                 {
                      int tkta=s[i]-'A';
                     if(tkta>=0 && tkta<=25)
                         tk=tkta+10;
                     else{
                         int tt=s[i]-'a';
                         tk=tt+36;
                     }
                 }
        }
     int z=abs(6- __builtin_popcount(tk));
     cnt+=z;
    }
    long long int a=3;
    ll ans=pow_mod(a,cnt)%MOD;
    cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007
ll pow_mod(ll a,ll b)
{
  ll ans=1;
  while(b)
  {
   if(b%2)
   ans=(ans*a)%MOD;
   a=(a*a)%MOD;
   b/=2;
  }
  return ans%MOD;
}
int main()
{
    string s;
    cin>>s;
    int n=s.size();
    long long int cnt=0;
    for(int i=0;i<n;i++)
    {   int tk;
        char d=s[i];
        if(d=='-')
            tk=62;
        else if(d=='_')
            tk=63;
        else
        {
            int tkt=s[i]-'0';
                if(tkt>=0 && tkt<=9)
                    tk=tkt;
                 else
                 {
                      int tkta=s[i]-'A';
                     if(tkta>=0 && tkta<=25)
                         tk=tkta+10;
                     else{
                         int tt=s[i]-'a';
                         tk=tt+36;
                     }
                 }
        }
     int z=abs(6- __builtin_popcount(tk));
     cnt+=z;
    }
    long long int a=2;
    long long int ans1=pow_mod(a,cnt)-1;

    ans1=(ans1*2+1)%MOD;
    ll cntx=cnt/2;
    if(cnt%2!=0)
        cntx++;
    ll ans2=pow_mod(a,cntx);
    ll ans=(ans1+ans2)%MOD;
    cout<<ans<<endl;
}


#include <iostream>
#include <stdio.h>
#include <string>
#define MOD 1000000007
using namespace std;
typedef long long ll;
ll i,j,n,h,ans,x,cur_h,k;
string s;
string pattern;
ll symbol_val[305];
int main()
{
	cin >> s;
	for (char i = '0'; i <= '9'; i++)
		pattern.push_back(i);
	for (char i = 'A'; i <= 'Z'; i++)
		pattern.push_back(i);
	for (char i = 'a'; i <= 'z'; i++)
		pattern.push_back(i);
	pattern.push_back('-');
	pattern.push_back('_');
	for (i = 0; i < 64; i++)
		symbol_val[pattern[i]] = i;
	ll ans = 1;
	for (i = 0; i < s.size(); i++)
	{
		ll x = symbol_val[s[i]];
		cout<<"x "<<x<<endl;
		for (j = 0; j < 6; j++)
			if ((x&(1<<j)) == 0)
			{
			   ans = (ans*3)%MOD;
			   cout<<"ans "<<ans<<endl;
			}
	}
	cout << ans << endl;
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <string>
#define MOD 1000000007
using namespace std;
typedef long long ll;
ll i,j,n,h,ans,x,cur_h,k;
string s;
string pattern;
ll symbol_val[305];
int main()
{
	cin >> s;
	for (char i = '0'; i <= '9'; i++)
		pattern.push_back(i);
	for (char i = 'A'; i <= 'Z'; i++)
		pattern.push_back(i);
	for (char i = 'a'; i <= 'z'; i++)
		pattern.push_back(i);
	pattern.push_back('-');
	pattern.push_back('_');
	for (i = 0; i < 64; i++)
		symbol_val[pattern[i]] = i;
	ll ans = 1;
	for (i = 0; i < s.size(); i++)
	{
		ll x = symbol_val[s[i]];
		//cout<<"x "<<x<<endl;
		for (j = 0; j < 6; j++)
			if ((x&(1<<j)) == 0)
			{
			   ans = (ans*3)%MOD;
			   //cout<<"ans "<<ans<<endl;
			}
	}
	cout << ans << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int id(char c) {
	if (c == '-')
		return 62;
	if (c == '_')
		return 63;
	if (islower(c))
		return c - 'a' + 36;
	if (isupper(c))
		return c - 'A' + 10;
	return c;
}
int mod = 1000000007;
long long Power(long long p) {
	if (p == 0)
		return 1ll;
	long long ans = Power(p / 2);
	ans %= mod;
	ans *= ans;
	ans %= mod;
	if (p & 1) {
		return (3 * ans) % mod;
	} else {
		return ans;
	}
}
int main() {
#ifndef ONLINE_JUDGE
	freopen("in", "r", stdin);
//freopen("out", "w", stdout);
#endif
	string s;
	int ans = 0;
	cin >> s;
	for (int i = 0; i < s.size(); ++i) {
		int a = id(s[i]);
		for (int j = 0; j < 6; ++j) {
			if ((a & 1) == 0)
				ans++;
			a >>= 1;
		}
	}
	cout<<Power(ans)<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int id(char c) {
	if (c == '-')
		return 62;
	if (c == '_')
		return 63;
	if (islower(c))
		return c - 'a' + 36;
	if (isupper(c))
		return c - 'A' + 10;
	return c;
}
int mod = 1000000007;
long long Power(long long p) {
	if (p == 0)
		return 1ll;
	long long ans = Power(p / 2);
	ans %= mod;
	ans *= ans;
	ans %= mod;
	if (p & 1) {
		return (2 * ans) % mod;
	} else {
		return ans;
	}
}
long long choose(int n,int r){
	if(r==0)return 1;
}
int main() {
#ifndef ONLINE_JUDGE
	freopen("in", "r", stdin);
//freopen("out", "w", stdout);
#endif
	string s;
	int ans = 0;
	cin >> s;
	for (int i = 0; i < s.size(); ++i) {
		int a = id(s[i]);
		for (int j = 0; j < 6; ++j) {
			if ((a & 1) == 0)
				ans++;
			a >>= 1;
		}
	}
	for (int i = 0; i <=ans; ++i) {
	total=(total+(choose(ans,i)*Power(i))%mod)%mod;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int id(char c) {
	if (c == '-')
		return 62;
	if (c == '_')
		return 63;
	if (islower(c))
		return c - 'a' + 36;
	if (isupper(c))
		return c - 'A' + 10;
	return c-'0';
}
int mod = 1000000007;
long long Power(long long p) {
	if (p == 0)
		return 1ll;
	long long ans = Power(p / 2);
	ans %= mod;
	ans *= ans;
	ans %= mod;
	if (p & 1) {
		return (3 * ans) % mod;
	} else {
		return ans;
	}
}
int main() {
#ifndef ONLINE_JUDGE
	freopen("in", "r", stdin);
//freopen("out", "w", stdout);
#endif
	string s;
	int ans = 0;
	cin >> s;
	for (int i = 0; i < s.size(); ++i) {
		int a = id(s[i]);
		for (int j = 0; j < 6; ++j) {
			if ((a & 1) == 0)
				ans++;
			a >>= 1;
		}
	}
	cout<<Power(ans)<<endl;
	return 0;
}


#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
typedef vector<int64_t> vi;
typedef pair< int64_t,int64_t> ii;
typedef vector<pair<int64_t, int64_t> > vp;
typedef vector<pair<int64_t, ii> > vpp;
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define INF 1e9
#define SIZE 200001
#define mod 1000000007
#define int int64_t
void solve();
int fastexp(int a,int p=mod-2)
{
    a%=mod;
    int ans=1;
    while(p>0)
    {
        if(p&1)
        {
            ans*=a;
            ans%=mod;
            p--;
        }
        else
        {
            a%=mod;
            a*=a;
            a%=mod;
            p/=2;
        }
    }
    ans%=mod;
    return ans;
}
int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    solve();
    return 0;
}
void solve()
{
    string ss;
    cin>>ss;
    map<char,int> m;
    for(int i=0;i<10;i++)
    {
        m[char(i+48)]=i;
    }
    for(int i=0;i<26;i++)
    {
        m[char(i+65)]=10+i;
        m[char(i+97)]=36+i;
    }
    m['-']=62;
    m['_']=63;
    int per[3*SIZE];
    int zro=0;
    for(int i=0;i<ss.length();i++)
    {
        bitset<6> z;
        z=m[ss[i]];
        zro+=(6-z.count());
    }
    per[0]=1;
    for(int i=1;i<=6e5;i++)
    {
        per[i]=per[i-1]*i;
        per[i]%=mod;
    }
    int ans=0;
    for(int i=0;i<=zro;i++)
    {
        int r1;
        r1=per[zro-i]*per[i];
        r1%=mod;
        r1=fastexp(r1);
        r1%=mod;
        r1=r1*per[zro];
        r1%=mod;
        int kk=fastexp(2,zro-i);
        kk%=mod;
        r1=r1*kk;
        r1%=mod;
        ans+=r1;
        ans%=mod;
    }
    cout<<ans<<"\n";
}


#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
typedef vector<int64_t> vi;
typedef pair< int64_t,int64_t> ii;
typedef vector<pair<int64_t, int64_t> > vp;
typedef vector<pair<int64_t, ii> > vpp;
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define INF 1e9
#define SIZE 200001
#define mod 1000000007
#define int int64_t
void solve();
int fastexp(int a,int p=mod-2)
{
    a%=mod;
    int ans=1;
    while(p>0)
    {
        if(p&1)
        {
            ans*=a;
            ans%=mod;
            p--;
        }
        else
        {
            a%=mod;
            a*=a;
            a%=mod;
            p/=2;
        }
    }
    ans%=mod;
    return ans;
}
int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    solve();
    return 0;
}
void solve()
{
    string ss;
    cin>>ss;
    map<char,int> m;
    for(int i=0;i<10;i++)
    {
        m[char(i+48)]=i;
    }
    for(int i=0;i<26;i++)
    {
        m[char(i+65)]=10+i;
        m[char(i+97)]=36+i;
    }
    m['-']=62;
    m['_']=63;
    int per[3*SIZE];
    int zro=0;
    for(int i=0;i<ss.length();i++)
    {
        bitset<6> z;
        z=m[ss[i]];
        zro+=(6-z.count());
    }
    per[0]=1;
    for(int i=1;i<=6e5;i++)
    {
        per[i]=per[i-1]*i;
        per[i]%=mod;
    }
    int ans=0;
    for(int i=0;i<=zro;i++)
    {
        int r1;
        r1=per[zro-i]*per[i];
        r1%=mod;
        r1=fastexp(r1);
        r1=r1*per[zro];
        r1%=mod;
        int kk=fastexp(2,zro-i);
        r1=r1*kk;
        r1%=mod;
        ans+=r1;
        ans%=mod;
    }
    cout<<ans<<"\n";
}


#include <bits/stdc++.h>
#define H ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ld long double
using namespace std;

map<char, int> mp;
vector <char> v;
ll mod = 1e9 + 7;

void init(){
	char c = '0';
	int i = 0;
	while (c <= '9') v.push_back(c),mp[c++] = i++;
	c = 'A';
	while (c <= 'Z') v.push_back(c),mp[c++] = i++;
	c = 'a';
	while (c <= 'z') v.push_back(c),mp[c++] = i++;
	mp['-'] = i++;
	v.push_back('-');
	mp['_'] = i++;
	v.push_back('_');
}

int main()
{
    H
	init();
    string s;
    cin >> s;
    ll ans = 1, cnt = 0;
    for (int i = 0; i < s.size(); i++, cnt = 0){
    	//cout << s[i] << ':' << endl;
    	for (int j = 0; j < v.size(); j++){
    		for (int k = 0; k < v.size(); k++)
    		if ((mp[v[j]] & mp[v[k]]) == mp[s[i]])cnt++;
    	}
    	ans = ((ans % mod) * (cnt % mod)) % mod;
    }

   cout << ans;
    return 0 ;
}


#include <bits/stdc++.h>
#define H ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ld long double
using namespace std;

int mp[130];
vector <char> v;
ll mod = 1e9 + 7;

void init(){
	char c = '0';
	int i = 0;
	while (c <= '9') v.push_back(c),mp[c++] = i++;
	c = 'A';
	while (c <= 'Z') v.push_back(c),mp[c++] = i++;
	c = 'a';
	while (c <= 'z') v.push_back(c),mp[c++] = i++;
	mp['-'] = i++;
	v.push_back('-');
	mp['_'] = i++;
	v.push_back('_');
}

int main()
{
    H
	init();
    string s;
    cin >> s;
    ll ans = 1, cnt = 0;
    for (int i = 0; i < s.size(); i++, cnt = 0){
    	//cout << s[i] << ':' << endl;
    	for (int j = 0; j < v.size(); j++){
    		for (int k = 0; k < v.size(); k++)
    		if ((mp[v[j]] & mp[v[k]]) == mp[s[i]])cnt++;
    	}
    	ans = ((ans) * (cnt)) % mod;
    }

   cout << ans;
    return 0 ;
}


#include <bits/stdc++.h>

using namespace std;

const int NN = 101010;
const int mod = 1e9 + 7;

char s[NN];

int get(char c){
	if(c >= '0' && c <= '9') return c - '0';
	if(c >= 'A' && c <= 'Z') return c - 'A' + 10;
	if(c >= 'a' && c <= 'z') return c - 'a' + 36;
	if(c == '-') return 62;
	if(c == '_') return 63;
}

int power(int a, int b, int ans = 1){
	for(; b; b >>= 1, a = 1LL * a * a % mod) if(b&1) ans = 1LL * ans * a % mod;
	return ans;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	cin >> s;
	int ans = 1;
	int n = strlen(s);
	for(int i = 0; i < n; i ++ ){
		int k = 6 - __builtin_popcount(get(s[i]));
		ans = 1LL * ans * power(3, k) % mod;
	}
	cout<<ans<<endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3fLL
typedef __int64 INT;
typedef pair<int, int> pii;
typedef pair<INT, char> pIc;
#define NN 100100
#define x first
#define y second
#define mod 1000000007
int a[NN];
char str[NN];
int p[30];
int pw(int a, int b){
	int res = 1;
	for(; b; b >>= 1, a = 1LL * a * a % mod) if(b & 1) res = 1LL * res * a % mod;
	return res;
}
int main(){
#ifndef ONLINE_JUDGE
	freopen("test.in", "r", stdin);
	freopen("test.out", "w", stdout);
#endif
	p[0] = 1;
	for(int i = 1; i < 30; i++) p[i] = p[i - 1] * 2;
	scanf("%s", str);
	int n = strlen(str);
	int k, cnt, t;
	int ans = 1;
	for(int i = 0; i < n; i++){
		if(str[i] == '-') k = 62;
		else if(str[i] == '_') k = 63;
		else if(isdigit(str[i])) k = str[i] - '0';
		else if(islower(str[i])) k = str[i] - 'a' + 36;
		else k = str[i] - 'A' + 10;
		t = 0, cnt = 0;
		while(k){
			t++;
			if(k % 2 == 0) cnt++;
			k /= 2;
		}
		cnt += (6 - t);
//		cerr<<cnt<<endl;
		int res = pw(3, cnt);
		ans = (1LL * ans * res) % mod;
	}
	printf("%d\n", ans);
}


#include <bits/stdc++.h>

using namespace std;
const int mod = 1e9 + 7;

#define NN 100010
char s[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	scanf("%s", s+1);
	int n = strlen(s+1);
  	int ans = 1;
  	for(int i=1; i<=n; i++){
		int x;
		if(s[i] >= '0' && s[i] <= '9'){
			x = s[i] - '0';
		}
		else if(s[i] >= 'A' && s[i] <= 'Z'){
			x = s[i] - 'A' + 10;
		}
		else if(s[i] >= 'a' && s[i] <= 'z'){
			x = s[i] - 'a' + 36;
		}
		else if(s[i] == '-'){
			x = 62;
		}
		else x = 63;
		int ct = 0;
		for(int j=0; j<6; j++){
			if(x & (1<<j)) ct++;
		}
		x = 6 - ct;
		while(x--){
			ans = 3LL * ans % mod;
		}
	}
	cout<<ans<<endl;
    return 0;
}


/// Bismillah Hir Rahmanir Rahim

#include <bits/stdc++.h>

using namespace std;

#define PI                    acos(-1.0)
#define Pi                    3.141592653589793
#define ff                    first
#define ss                    second
#define pb                    push_back
#define space                 " "
#define all(x)                (x).begin(), (x).end()
#define clr(ar)               memset(ar, 0, sizeof(ar))
#define eprintf(...)          fprintf(stderr, __VA_ARGS__)

/*
template <class T> T gcd(T a,T b){ if(b == 0) return a; return gcd( b,a % b ); }
template <class T> T lcm(T a, T b ){ return ( a * b ) / gcd( a,b ); }
template<class T> string ToString(const T &x){ stringstream s; s << x; return s.str(); }
template<class T> int ToInteger(const T &x){ stringstream s; s << x; int r; s >> r; return r; }
*/

const int dr[] = { -1, 1, 0, 0 }; /// 4 side moves.
const int dc[] = { 0, 0, -1, 1 };
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }; /// 8 side moves.
const int dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
const int kr[] = { 1, 1, -1, -1, 2, 2, -2, -2 }; /// Knight Moves.
const int kc[] = { 2, -2, 2, -2, 1, -1, 1, -1 };

typedef  long long int            ll;
typedef  map<string,int>          msi;
typedef  map<string, string>      mss;
typedef  map<int,int>	          mii;
typedef  map<ll, ll>              mll;
typedef  map<char,int>            mci;
typedef  map<int,string>	      mis;
typedef  pair<int,int> 	          ii;
typedef  pair<string, int>        psi;
typedef  pair<string, string>     pss;
typedef  vector<int> 	          vi;
typedef  vector<string> 	      vs;
typedef  vector<char>	          vc;
typedef  vector< ii >             vii;

template<class T1> void deb(T1 e1)
{
    cout << e1 << endl;
}
template<class T1,class T2> void deb(T1 e1, T2 e2)
{
    cout << e1 << space << e2 << endl;
}
template<class T1,class T2,class T3> void deb(T1 e1, T2 e2, T3 e3)
{
    cout << e1 << space << e2 << space << e3 << endl;
}

#define sf                    scanf
#define pf                    printf

#define sf1(a)                scanf("%d", &a)
#define sf2(a,b)              scanf("%d %d",&a, &b)
#define sf3(a,b,c)            scanf("%d %d %d", &a, &b, &c)
#define sf4(a,b,c,d)          scanf("%d %d %d %d", &a, &b, &c, &d)

#define sf1ll(a)              scanf("%I64d", &a)
#define sf2ll(a,b)            scanf("%I64d %I64d", &a, &b)
#define sf3ll(a,b,c)          scanf("%I64d %I64d %I64d", &a, &b, &c)
#define sf4ll(a,b,c,d)        scanf("%I64d %I64d %I64d %I64d", &a, &b, &c, &d)

#define READ                  freopen("in.txt", "r", stdin);
#define WRITE                 freopen("out.txt", "w", stdout);
/// The End.

void check_time()
{
#ifdef the_badcoder
    eprintf("%.5lf\n", (double)clock() / CLOCKS_PER_SEC);
#endif
}

const int res = 1e5 + 10;
const ll mod = 1e9 + 7;

ll dp[res];

string letter;
ll a[res];

void pre_calc_string()
{
    for( char i = '0'; i <= '9'; i++ )
    {
        letter.push_back( i );
    }
    for( char i = 'A'; i <= 'Z'; i++ ){
        letter.push_back( i );
    }
    for( char i = 'a'; i <= 'z'; i++ )
    {
        letter.push_back( i );
    }
    letter.push_back('-');
    letter.push_back('_');

    for( int i = 0; i < 64; i++ )
    {
        a[ letter[i] ] = i;
    }
}

void pre_calc()
{
    for( int i = 0; i < 64; i++ )
    {
        int digit = 0;

        for( int j = 0; j < 64; j++ )
        {
            for( int k = 0; k <= 64; k++ )
            {
                if( (j & k) == i ){
                    digit++;
                }
            }
        }
        dp[ i ] = digit;
    }
}
int main()
{
    string s;
    ll sum = 1;

    cin >> s;
    pre_calc();
    pre_calc_string();

    for( int i = 0; i < s.size(); i++ )
    {
        ll x = a[ s[i] ];
        ll digit = dp[ x ];

        //deb( x, digit );

        sum *= digit;
        sum %= mod;
    }

    deb( sum );

    return 0;
}


/// Bismillah Hir Rahmanir Rahim

#include <bits/stdc++.h>

using namespace std;

#define PI                    acos(-1.0)
#define Pi                    3.141592653589793
#define ff                    first
#define ss                    second
#define pb                    push_back
#define space                 " "
#define all(x)                (x).begin(), (x).end()
#define clr(ar)               memset(ar, 0, sizeof(ar))
#define eprintf(...)          fprintf(stderr, __VA_ARGS__)

/*
template <class T> T gcd(T a,T b){ if(b == 0) return a; return gcd( b,a % b ); }
template <class T> T lcm(T a, T b ){ return ( a * b ) / gcd( a,b ); }
template<class T> string ToString(const T &x){ stringstream s; s << x; return s.str(); }
template<class T> int ToInteger(const T &x){ stringstream s; s << x; int r; s >> r; return r; }
*/

const int dr[] = { -1, 1, 0, 0 }; /// 4 side moves.
const int dc[] = { 0, 0, -1, 1 };
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }; /// 8 side moves.
const int dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
const int kr[] = { 1, 1, -1, -1, 2, 2, -2, -2 }; /// Knight Moves.
const int kc[] = { 2, -2, 2, -2, 1, -1, 1, -1 };

typedef  long long int            ll;
typedef  map<string,int>          msi;
typedef  map<string, string>      mss;
typedef  map<int,int>	          mii;
typedef  map<ll, ll>              mll;
typedef  map<char,int>            mci;
typedef  map<int,string>	      mis;
typedef  pair<int,int> 	          ii;
typedef  pair<string, int>        psi;
typedef  pair<string, string>     pss;
typedef  vector<int> 	          vi;
typedef  vector<string> 	      vs;
typedef  vector<char>	          vc;
typedef  vector< ii >             vii;

template<class T1> void deb(T1 e1)
{
    cout << e1 << endl;
}
template<class T1,class T2> void deb(T1 e1, T2 e2)
{
    cout << e1 << space << e2 << endl;
}
template<class T1,class T2,class T3> void deb(T1 e1, T2 e2, T3 e3)
{
    cout << e1 << space << e2 << space << e3 << endl;
}

#define sf                    scanf
#define pf                    printf

#define sf1(a)                scanf("%d", &a)
#define sf2(a,b)              scanf("%d %d",&a, &b)
#define sf3(a,b,c)            scanf("%d %d %d", &a, &b, &c)
#define sf4(a,b,c,d)          scanf("%d %d %d %d", &a, &b, &c, &d)

#define sf1ll(a)              scanf("%I64d", &a)
#define sf2ll(a,b)            scanf("%I64d %I64d", &a, &b)
#define sf3ll(a,b,c)          scanf("%I64d %I64d %I64d", &a, &b, &c)
#define sf4ll(a,b,c,d)        scanf("%I64d %I64d %I64d %I64d", &a, &b, &c, &d)

#define READ                  freopen("in.txt", "r", stdin);
#define WRITE                 freopen("out.txt", "w", stdout);
/// The End.

void check_time()
{
#ifdef the_badcoder
    eprintf("%.5lf\n", (double)clock() / CLOCKS_PER_SEC);
#endif
}

const int res = 1e5 + 10;
const ll mod = 1e9 + 7;

string letter;
ll a[res];

void pre_calc()
{
    for( char i = '0'; i <= '9'; i++ )
    {
        letter.push_back( i );
    }
    for( char i = 'A'; i <= 'Z'; i++ ){
        letter.push_back( i );
    }
    for( char i = 'a'; i <= 'z'; i++ )
    {
        letter.push_back( i );
    }
    letter.push_back('-');
    letter.push_back('_');

    for( int i = 0; i < 64; i++ )
    {
        a[ letter[i] ] = i;
    }
}

int main()
{
    string s;
    ll sum = 1;

    cin >> s;
    pre_calc();

    for( int i = 0; i < s.size(); i++ )
    {
        ll x = a[ s[i] ];
        //deb( x );

        for( ll j = 0; j < 6; j++ )
        {
            //deb( x, ( 1 << j ), x & ( 1 << j ) );
            if( ( x & ( 1 << j ) ) == 0 ){
                sum = ( sum * 3 ) % mod;
            }
        }
    }

    deb( sum );

    return 0;
}


/// Bismillah Hir Rahmanir Rahim

#include <bits/stdc++.h>

using namespace std;

#define PI                    acos(-1.0)
#define Pi                    3.141592653589793
#define ff                    first
#define ss                    second
#define pb                    push_back
#define space                 " "
#define all(x)                (x).begin(), (x).end()
#define clr(ar)               memset(ar, 0, sizeof(ar))
#define eprintf(...)          fprintf(stderr, __VA_ARGS__)

/*
template <class T> T gcd(T a,T b){ if(b == 0) return a; return gcd( b,a % b ); }
template <class T> T lcm(T a, T b ){ return ( a * b ) / gcd( a,b ); }
template<class T> string ToString(const T &x){ stringstream s; s << x; return s.str(); }
template<class T> int ToInteger(const T &x){ stringstream s; s << x; int r; s >> r; return r; }
*/

const int dr[] = { -1, 1, 0, 0 }; /// 4 side moves.
const int dc[] = { 0, 0, -1, 1 };
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }; /// 8 side moves.
const int dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
const int kr[] = { 1, 1, -1, -1, 2, 2, -2, -2 }; /// Knight Moves.
const int kc[] = { 2, -2, 2, -2, 1, -1, 1, -1 };

typedef  long long int            ll;
typedef  map<string,int>          msi;
typedef  map<string, string>      mss;
typedef  map<int,int>	          mii;
typedef  map<ll, ll>              mll;
typedef  map<char,int>            mci;
typedef  map<int,string>	      mis;
typedef  pair<int,int> 	          ii;
typedef  pair<string, int>        psi;
typedef  pair<string, string>     pss;
typedef  vector<int> 	          vi;
typedef  vector<string> 	      vs;
typedef  vector<char>	          vc;
typedef  vector< ii >             vii;

template<class T1> void deb(T1 e1)
{
    cout << e1 << endl;
}
template<class T1,class T2> void deb(T1 e1, T2 e2)
{
    cout << e1 << space << e2 << endl;
}
template<class T1,class T2,class T3> void deb(T1 e1, T2 e2, T3 e3)
{
    cout << e1 << space << e2 << space << e3 << endl;
}

#define sf                    scanf
#define pf                    printf

#define sf1(a)                scanf("%d", &a)
#define sf2(a,b)              scanf("%d %d",&a, &b)
#define sf3(a,b,c)            scanf("%d %d %d", &a, &b, &c)
#define sf4(a,b,c,d)          scanf("%d %d %d %d", &a, &b, &c, &d)

#define sf1ll(a)              scanf("%I64d", &a)
#define sf2ll(a,b)            scanf("%I64d %I64d", &a, &b)
#define sf3ll(a,b,c)          scanf("%I64d %I64d %I64d", &a, &b, &c)
#define sf4ll(a,b,c,d)        scanf("%I64d %I64d %I64d %I64d", &a, &b, &c, &d)

#define READ                  freopen("in.txt", "r", stdin);
#define WRITE                 freopen("out.txt", "w", stdout);
/// The End.

void check_time()
{
#ifdef the_badcoder
    eprintf("%.5lf\n", (double)clock() / CLOCKS_PER_SEC);
#endif
}

const int res = 1e5 + 10;
const ll mod = 1e9 + 7;

ll dp[res];

string letter;
ll a[res];

void pre_calc_string()
{
    for( char i = '0'; i <= '9'; i++ )
    {
        letter.push_back( i );
    }
    for( char i = 'A'; i <= 'Z'; i++ ){
        letter.push_back( i );
    }
    for( char i = 'a'; i <= 'z'; i++ )
    {
        letter.push_back( i );
    }
    letter.push_back('-');
    letter.push_back('_');

    for( int i = 0; i < 64; i++ )
    {
        a[ letter[i] ] = i;
    }
}

void pre_calc()
{
    for( int i = 0; i < 64; i++ )
    {
        ll digit = 0;

        for( int j = 0; j < 64; j++ )
        {
            for( int k = 0; k < 64; k++ )
            {
                if( (j & k) == i ){
                    digit++;
                }
            }
        }
        dp[ i ] = digit;
    }
}
int main()
{
    string s;
    ll sum = 1;

    cin >> s;
    pre_calc();
    pre_calc_string();

    for( int i = 0; i < s.size(); i++ )
    {
        ll x = a[ s[i] ];
        ll digit = dp[ x ];

        //deb( x, digit );

        sum *= digit;
        sum %= mod;
    }

    deb( sum );

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define long long long
#define pll pair < long , long >
#define vll vector < pll >
#define ml map < long , long >
#define mll map < pll , long >
#define x first
#define y second
#define vl vector < long >
#define io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
    io
    string s;
    cin>>s;
    map < char , long > w;
    long i,v[64]={0},ans=1,h=1e9+7,j,c,k;
    for(i=0;i<10;++i)
    w[i]=i;
    for(i=0;i<26;++i)
    w['A'+i]=10+i;
    for(i=0;i<26;++i)
    w['a'+i]=36+i;
    w['-']=62;
    w['_']=63;
    for(i=0;i<64;++i)
    for(j=0;j<64;++j)
    for(k=0;k<64;++k)
    if((j&k)==i) v[i]++;
    for(i=0;i<s.length();++i)
    ans=(ans*v[w[s[i]]])%h;
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define long long long
#define pll pair < long , long >
#define vll vector < pll >
#define ml map < long , long >
#define mll map < pll , long >
#define x first
#define y second
#define vl vector < long >
#define io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
    io
    string s;
    cin>>s;
    map < char , long > w;
    long i,v[1000]={0},ans=1,h=1e9+7,j,c,k;
    for(i=0;i<10;++i)
    w[i+'0']=i;
    for(i=0;i<26;++i)
    w['A'+i]=10+i;
    for(i=0;i<26;++i)
    w['a'+i]=36+i;
    w['-']=62;
    w['_']=63;
    for(j=0;j<64;++j)
    for(k=0;k<64;++k)
    v[(j&k)]++;
    for(i=0;i<s.length();++i)
    ans=(ans*v[w[s[i]]])%h;
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define long long long
#define pll pair < long , long >
#define vll vector < pll >
#define ml map < long , long >
#define mll map < pll , long >
#define x first
#define y second
#define vl vector < long >
#define io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
    io
    string s;
    cin>>s;
    map < char , long > w;
    long i,v[64],ans=1,h=1e9+7,j,c;
    for(i=0;i<10;++i)
    w[i]=i;
    for(i=0;i<26;++i)
    w['A'+i]=10+i;
    for(i=0;i<26;++i)
    w['a'+i]=36+i;
    w['-']=62;
    w['_']=63;
    for(i=0;i<64;++i)
    v[i]=1;
    for(i=0;i<64;++i)
    {
        c=0;
        for(j=0;j<8;++j)
        if(i+(1<<j)<64 && !(i&(1<<j))) c++;
        while(c--)
        v[i]=(v[i]*3)%h;
    }
    for(i=0;i<s.length();++i)
    ans=(ans*v[w[s[i]]])%h;
    cout<<ans;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;
string a;
long long  toNum ( char c ) {
    if ( c >= '0' && c <= '9' ) { return c-'0'+0;}
    if ( c >= 'A' && c <= 'Z' ) { return c-'A'+10;}
    if ( c >= 'a' && c <= 'z' ) { return c-'a'+36;}
    if ( c == '-' ) { return 62; }
    if ( c == '_' ) { return 63; }
}

long long cntB0 ( long long  x ) {
    long long  ret = 0;
    for ( long long  i = 0 ; (1<<i) < 64 ; i ++ ) {
        if ( ( x&(1<<i) ) == 0 ) { ret ++; }
    }
    return ret;
}
long long  cntC[64] = { 1 }, mod = 1000000007;

int main () {

    for ( long long  i = 1 ; i < 10 ; i ++ ) {
        cntC[i] = cntC[i-1]*2 + 1;
    }
    long long  ans = 1;
    cin >> a;
    for ( long long  i = 0 ; i < a.size() ; i ++ ) {
        long long  c = toNum ( a[i] );

        ans *= cntC[ cntB0(c) ];
        ans %= mod;
    }
    cout << ans << "\n";

    return 0;
}


#include <iostream>
#include <string>
using namespace std;
string a;
long long  toNum ( char c ) {
    if ( c >= '0' && c <= '9' ) { return c-'0'+0;}
    if ( c >= 'A' && c <= 'Z' ) { return c-'A'+10;}
    if ( c >= 'a' && c <= 'z' ) { return c-'a'+36;}
    if ( c == '-' ) { return 62; }
    if ( c == '_' ) { return 63; }
}

long long cntB0 ( long long  x ) {
    long long  ret = 0;
    for ( long long  i = 0 ; (1<<i) < 64 ; i ++ ) {
        if ( ( x&(1<<i) ) == 0 ) { ret ++; }
    }
    return ret;
}
long long  cntC[64] = { 1 }, mod = 1000000007;

int main () {

    for ( long long  i = 1 ; i < 10 ; i ++ ) {
        cntC[i] = cntC[i-1]*3;
    }
    long long  ans = 1;
    cin >> a;
    for ( long long  i = 0 ; i < a.size() ; i ++ ) {
        long long  c = toNum ( a[i] );

//        cout << cntB0(c) << " " << cntC[ cntB0(c) ] << " : " << ans << "\n";

        ans *= cntC[ cntB0(c) ];
        ans %= mod;
    }
    cout << ans << "\n";

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<char, int>Val;
string s;
int V;
long long res=1,MOD=(long long)(1e9+7);
int main()
{
    for (char c = '0'; c <= '9'; c++)
    {
        Val[c]=V++;
    }
    for (char c = 'A'; c <= 'Z'; c++)
    {
        Val[c] = V++;
    }
    for (char c = 'a'; c <= 'z'; c++)
    {
        Val[c] = V++;
    }
    Val['-'] = V++;
    Val['_'] = V++;

    cin >> s;
    for (auto i : s)
    {
        int x = Val[i],bit=6;
        while (bit--)
        {
            if ((!(x % 2)))
            {
                res *= 3;
                res %= MOD;
            }
            x /= 2;
        }
    }
    cout << res << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<char, int>Val;
string s;
int V;
long long res,MOD=(long long)(1e9+7);
long long fastpower(long long b, long long p)
{
   long long ans = 1;
    while (p)
    {
        if (p % 2)
        {
            ans = (((ans%MOD)*(b%MOD))%MOD);
        }
        b = b*b;
        p /= 2;
    }

    return ans;
}

int main()
{
    for (char c = '0'; c <= '9'; c++)
    {
        Val[c]=V++;
    }
    for (char c = 'A'; c <= 'Z'; c++)
    {
        Val[c] = V++;
    }
    for (char c = 'a'; c <= 'z'; c++)
    {
        Val[c] = V++;
    }
    Val['-'] = V++;
    Val['_'] = V++;

    cin >> s;
    for (auto i : s)
    {
        int x = Val[i],bit=6;
        while (bit--)
        {
            res += (!(x % 2));
            x /= 2;
        }
    }
    cout << fastpower(3, res) << endl;
    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
     for(char i='A';i<='Z';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);

    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];

           for(int j=0;j<6;j++){
               if(a&(1<<j) == 0){
                   ans = (ans*3)%MOD;
               }
           }

    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);
    for(char i='A';i<='Z';i++)pattern.push_back(i);
    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];
        cout<<a<<endl;
        while(a>0){
            if(!a&1){
                ans = (ans*3)%MOD;
            }
            a = a>>1;
        }
    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000007
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
     for(char i='A';i<='Z';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);

    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];

           for(int j=0;j<6;j++){
               if(a&(1<<j) == 0){
                   ans = (ans*3)%MOD;
               }
           }

    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
     for(char i='A';i<='Z';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);

    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];
        cout<<a<<endl;
        while(a>0){
            if(!a&1){
                ans = (ans*3)%MOD;
            }
            a = a>>1;
        }
    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);
    for(char i='A';i<='Z';i++)pattern.push_back(i);
    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];
        while(a>0){
            if(!a&1){
                ans = (ans*3)%MOD;
            }
        }
    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
     for(char i='A';i<='Z';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);

    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];

        while(a>0){
            if(a&1 == 0){
                ans = (ans*3)%MOD;
            }
            a = a>>1;
        }
    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);
    for(char i='A';i<='Z';i++)pattern.push_back(i);
    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];
        while(a>0){
            if(!a&1){
                ans = (ans*3)%MOD;
            }
        }
    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
     for(char i='A';i<='Z';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);

    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];

        while(a>0){
            if(a&1 == 0){
                ans = (ans*3)%MOD;
                cout<<ans<<endl;
            }
            a = a>>1;
        }
    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);
    for(char i='A';i<='Z';i++)pattern.push_back(i);
    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];
        while(a>0){
            if(!a&1){
                ans = (ans*3)%MOD;
            }
            a = a>>1;
        }
    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000000 + 7
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
     for(char i='A';i<='Z';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);

    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];

           for(int j=0;j<6;j++){
               if(!(a&(1<<j))){
                   ans = (ans*3)%MOD;
               }
           }

    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
typedef long long ll;
#define MOD 1000000007
using namespace std;

string pattern;
ll getval[1000];

int main(){

    string s;cin>>s;
    for(char i='0';i<='9';i++)pattern.push_back(i);
     for(char i='A';i<='Z';i++)pattern.push_back(i);
    for(char i='a';i<='z';i++)pattern.push_back(i);

    pattern.push_back('-');
    pattern.push_back('_');

    for(int i=0;i<64;i++){
        getval[pattern[i]] = i;
    }

    ll ans = 1;

    for(int i=0;i<s.length();i++){
        ll a = getval[s[i]];

           for(int j=0;j<6;j++){
               if((a&(1<<j)) == 0){
                   ans = (ans*3)%MOD;
               }
           }

    }

    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int decToBinary (int n)
        {
            int count=0;
            while( n )
            {
            n = n&(n-1);
               count++;
            }
            return (6-count);
    }
int main()
{
    string a;
    cin>>a;
    int n=a.size();
    long long ans=1;
    long long c=0;
    for(int i=0;i<n;i++)
    {
        long long temp1=0;
        if( a[i]>='0' and a[i] <='9')
        {
            temp1=decToBinary(a[i]-'0');
            cout<<a[i];
        }
        else if(a[i]>='A' and a[i] <='Z')
        {
            temp1=decToBinary(a[i]-'A'+10);
        }
        else if(a[i]>='a' and a[i] <='z')
        {
            temp1=decToBinary(a[i]-'a'+36);
        }
        else if(a[i]=='-')
        {
            temp1=decToBinary(62);
        }
        else
        {
            temp1=decToBinary(63);
        }
        //c+=temp1;
        long long t=fmod(pow(3,temp1), 1000000007);
        ans=fmod(ans*t,1000000007);
    }
    //long long int e=1000000007;

    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int decToBinary (int n)
        {
            int count=0;
            while( n )
            {
            n = n&(n-1);
               count++;
            }
            return (6-count);
    }
int main()
{
    string a;
    cin>>a;
    int n=a.size();
    long long ans=1;
    long long c=0;
    for(int i=0;i<n;i++)
    {
        long long temp1=0;
        if( a[i]>='0' and a[i] <='9')
        {
            temp1=decToBinary(a[i]-'0');
        //    cout<<a[i];
        }
        else if(a[i]>='A' and a[i] <='Z')
        {
            temp1=decToBinary(a[i]-'A'+10);
        }
        else if(a[i]>='a' and a[i] <='z')
        {
            temp1=decToBinary(a[i]-'a'+36);
        }
        else if(a[i]=='-')
        {
            temp1=decToBinary(62);
        }
        else
        {
            temp1=decToBinary(63);
        }
        //c+=temp1;
        long long t=fmod(pow(3,temp1), 1000000007);
        ans=fmod(ans*t,1000000007);
    }
    //long long int e=1000000007;

    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int decToBinary (int n)
        {
            int count=0;
            while( n )
            {
            n = n&(n-1);
               count++;
            }
            return (6-count);
    }
// int decToBinary(int n)
// {
//     int temp =0;
//     for (int i = 6; i >= 0; i--) {
//         int k = n >> i;
//         if (k & 1)
//         {
//             continue;
//         }
//         else
//         {
//             temp+= 1;
//         }
//         cout<<temp<<endl;
//     }
//     return temp;
// }
int main()
{
    string a;
    cin>>a;
    int n=a.size();
    //string s[n];
    long long ans=1;
    for(int i=0;i<n;i++)
    {
        long long temp1=0;
        if( a[i]>='0' and a[i] <='9')
        {
            temp1=decToBinary(a[i]-'0');
            cout<<a[i];
        }
        else if(a[i]>='A' and a[i] <='Z')
        {
            temp1=decToBinary(a[i]-'A'+10);
        }
        else if(a[i]>='a' and a[i] <='z')
        {
            temp1=decToBinary(a[i]-'a'+36);
        }
        else if(a[i]=='-')
        {
            temp1=decToBinary(62);
        }
        else
        {
            temp1=decToBinary(63);
        }
        //long long int t=fmod(pow(3,temp1),1000000007);
        //cout<<t;
        ans= fmod((ans* pow(3,temp1)), 1000000007);
    }
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int decToBinary (int n)
        {
            int count=0;
            while( n )
            {
            n = n&(n-1);
               count++;
            }
            return (6-count);
    }
// int decToBinary(int n)
// {
//     int temp =0;
//     for (int i = 6; i >= 0; i--) {
//         int k = n >> i;
//         if (k & 1)
//         {
//             continue;
//         }
//         else
//         {
//             temp+= 1;
//         }
//         cout<<temp<<endl;
//     }
//     return temp;
// }
int main()
{
    string a;
    cin>>a;
    int n=a.size();
    //string s[n];
    long long ans=1;
    long long c=0;
    for(int i=0;i<n;i++)
    {
        long long temp1=0;
        if( a[i]>='0' and a[i] <='9')
        {
            temp1=decToBinary(a[i]-'0');
            cout<<a[i];
        }
        else if(a[i]>='A' and a[i] <='Z')
        {
            temp1=decToBinary(a[i]-'A'+10);
        }
        else if(a[i]>='a' and a[i] <='z')
        {
            temp1=decToBinary(a[i]-'a'+36);
        }
        else if(a[i]=='-')
        {
            temp1=decToBinary(62);
        }
        else
        {
            temp1=decToBinary(63);
        }
        //long long int t=fmod(pow(3,temp1),1000000007);
        //cout<<t;
        c+=temp1;
        //ans= fmod((ans* pow(3,temp1)), 1000000007);
    }
    long long int t=fmod(pow(3,c), 1000000007);
    cout<<t<<endl;
    return 0;
}


#include "bits/stdc++.h"

using namespace std;

long long give(char a) {
        if(a == '-') {
                return 62;
        }
        if(a == '_') {
                return 63;
        }
        if(a <= 122 && a >= 97) {
                return a - 61;
        }
        if(a <= 90 && a >= 65) {
                return a - 55;
        }
        if(a >= 48 && a <= 57) {
                return a - 48;
        }
        return 0;
}

string s;

const long long M = 1e9 + 7;
map < long long , long long > a;
int main() {
        cin >> s;
        for(long long i = 0 ; i < 64 ; i++) {
                for(long long j = 0 ; j < 64 ; j++) {
                        a[(i&j)]++;
                }
        }
        long long res = 1;
        for(long long i = 0 ; i < s.length() ; i++) {
                res *= a[give(s[i])];
                res %= M;
        }
        cout << res << endl;
        return 0;
}


#include "bits/stdc++.h"

using namespace std;

long long give(char a) {
        if(a == '-') {
                return 62;
        }
        if(a == '_') {
                return 63;
        }
        if(a <= 122 && a >= 97) {
                return a - 61;
        }
        if(a <= 90 && a >= 65) {
                return a - 55;
        }
        if(a >= 48 && a <= 57) {
                return a - 48;
        }
        return 0;
}

string s;

const long long M = 1e9 + 7;
map < long long , long long > a;
int main() {
        cin >> s;
        for(long long i = 1 ; i < 64 ; i++) {
                for(long long j = 1 ; j < 64 ; j++) {
                        a[(i&j)]++;
                }
        }
        long long res = 1;
        for(long long i = 0 ; i < s.length() ; i++) {
                res *= a[give(s[i])];
                res %= M;
        }
        cout << res << endl;
        return 0;
}


#include <bits/stdc++.h>

using namespace std;
long long mas[100], dp[100002];
int MOD = 1e9 + 7;
int main()  {
  long long a, b;
  string s;
  cin >> s;
  for (int i = 0; i <= 63; i++) {
    for (int j = 0; j <= 63; j++) {
      int res = (i & j);
      if (res == 61) {
        cout << i << " " <<  j << endl;
      }
      mas[res]++;
    }
  }
  int n = s.size();
  int ans;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] >= '0' && s[i] <= '0') {
       ans = s[i] - '0';
    } else if (s[i] >= 'A' && s[i] <= 'Z') {
       ans = (s[i] - 'A') + 10;
    } else if (s[i] >= 'a' && s[i] <= 'z') {
       ans = (s[i] - 'a') + 36;
    } else if (s[i] == '-') {
       ans = 62;
    } else  {
       ans = 63;
    }
   dp[i] = mas[ans];
   if (i) {
    dp[i] *= dp[i - 1];
    dp[i] %= MOD;
   }
  }
  cout << dp[n - 1];

  return 0;
}


#include <bits/stdc++.h>
#define int long long
#define mod 1000000007;
using namespace std;

int32_t main(){

  string s; cin>>s;
  map <char,int> m;
  int count = 0;
  for(int i='0' ; i<='9' ; i++) m[i] = count++;
  for(int i='A' ; i<='Z' ; i++) m[i] = count++;
  for(int i='a' ; i<='z' ; i++) m[i] = count++;
  m['-'] = count++; m['_'] = count++;

  int ans = 1;
  for(int i=0 ; s[i] ; i++){
     int n = m[s[i]];
     for(int j=0 ; j<6 ; j++){
         if(!(n&(1LL<<j))) ans = (ans*3) % mod;
     }
  }
       cout<<ans;
}


#include <bits/stdc++.h>
#define int long long
#define mod 1000000007;
using namespace std;

int32_t main(){

  string s; cin>>s;
  map <char,int> m;
  int count = 0;
  for(int i='0' ; i<='9' ; i++) m[i] = count++;
  for(int i='A' ; i<='Z' ; i++) m[i] = count++;
  for(int i='a' ; i<='z' ; i++) m[i] = count++;
  m['-'] = count++; m['_'] = count++;

  int ans = 1;
  for(int i=0 ; s[i] ; i++){
     int n = m[s[i]];
     for(int j=0 ; j<6 ; j++){
         if(!(n&(1LL<<j))) ans = (ans*3) % mod;
     }
  }
     if(ans==1) cout<<0<<endl;
     else cout<<ans;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

void Egriiiiiiiii()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}

unsigned int countSetBits(unsigned int n)
{
    unsigned int count = 0;
    while (n) {
        count += n & 1;
        n >>= 1;
    }
    return count;
}
int mod = 1e9+7 ;
int fpow(int b, int p){               //O(Log(p))
if(!p)  return 1;
int ret = fpow(b, p/2)%mod;
return (p&1 ? (((ret%mod)*(ret%mod)*(b%mod))%mod) : (((ret%mod)*(ret%mod))%mod)) ;
}

map<ll,bool>mp ;
int main()
{
Egriiiiiiiii() ;
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
string s ;
cin>>s;
int n ;
ll ans=1,t ;
for(int i=0 ;i<(int)s.size() ;i++)
{
                t = 0 ;
               if(s[i]=='-') n = 62 ;
               else if(s[i]=='_') n = 63 ;
               else if(s[i]>='a' && s[i]<='z') n = (s[i]-'a')+36 ;
               else if(s[i]>='0' && s[i]<='9') n = s[i]-'0' ;
               else
                              n = (s[i]-'A')+10 ;
                t ==__builtin_popcount(n);
               t = fpow(1LL*3,t) ; t%=mod ;
               ans = (ans%mod)*t;
               ans %=mod ;

}
cout<<ans<<endl ;

return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

void Egriiiiiiiii()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}

unsigned int countSetBits(unsigned int n)
{
    unsigned int count = 0;
    while (n) {
        count += n & 1;
        n >>= 1;
    }
    return count;
}
int mod = 1e9+7 ;
int fpow(int b, int p){               //O(Log(p))
if(!p)  return 1;
int ret = fpow(b, p/2)%mod;
return (p&1 ? (((ret%mod)*(ret%mod)*(b%mod))%mod) : (((ret%mod)*(ret%mod))%mod)) ;
}

map<ll,bool>mp ;
int main()
{
Egriiiiiiiii() ;
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
string s ;
cin>>s;
int n ;
ll ans=1,t ;
for(int i=0 ;i<(int)s.size() ;i++)
{
                t = 0 ;
               if(s[i]=='-') n = 62 ;
               else if(s[i]=='_') n = 63 ;
               else if(s[i]>='a' && s[i]<='z') n = (s[i]-'a')+36 ;
               else if(s[i]>='0' && s[i]<='9') n = s[i]-'0' ;
               else
                              n = (s[i]-'A')+10 ;
                              while(n){
                                             if(n%2==1)t++ ;
                                             n/=2 ;
                              }
           //     t =__builtin_popcount(n); //cout<<t<<endl;
               t = fpow(1LL*3,6-t) ; t%=mod ;
               ans = (ans%mod)*t;
               ans %=mod ;

}
cout<<ans<<endl ;

return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vec;

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define scn(n) scanf("%d",&n)
#define scnll(n) scanf("%lld",&n)
#define scn2(n,m) scanf("%d%d",&n,&m)
#define scn3(n,m,w) scanf("%d%d%d",&n,&m,&w)
#define scn2ll(n,m) scanf("%lld%lld",&n,&m)
#define atoz(v) v.begin(),v.end()
#define ratoz(v) v.rbegin(),v.rend()
#define Fill(a,v) memset(a,v,sizeof(a))
#define sz(v) v.size()
#define fi first
#define se second
#define inf 1e9
#define pi acos(-1.0)
#define sqr(x) x*x
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define ten(n) (int)1e##n
#define tenll(n) (lli)1e##n

int Set(int N,int pos){return N=N | (1<<pos);}
int reset(int N,int pos){return N= N & ~(1<<pos);}
bool check(int N,int pos){return (bool)(N & (1<<pos));}

int main()
{
    ///freopen("debug.txt","w",stdout);
    /*
     ios_base::sync_with_stdio(false);
    cin.tie(0);
    */
    string s;
    cin>>s;
    lli ans = 1LL , mod = tenll(9) + 7LL;

    map<char,int>mip;

    for(int i=0; i<10; i++) mip[i+'0'] = i;
    int lo = 10;

    for(char c = 'A' ; c<='Z'; c++)mip[c] = lo++;
    for(char c = 'a' ; c<='z'; c++)mip[c] = lo++;

    mip['-'] = lo++;
    mip['_'] = lo;

    for(int i=0; i<sz(s); i++){

        int k = mip[s[i]];

        lli cnt=0LL;

        for(int j=0 ; j<64 ; j++){

            for(int m = 0; m<64 ; m++)if( (j&m) == k)cnt++;
        }

        ans *= cnt;

        ans %= mod;

    }
    cout<<ans;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vec;

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define scn(n) scanf("%d",&n)
#define scnll(n) scanf("%lld",&n)
#define scn2(n,m) scanf("%d%d",&n,&m)
#define scn3(n,m,w) scanf("%d%d%d",&n,&m,&w)
#define scn2ll(n,m) scanf("%lld%lld",&n,&m)
#define atoz(v) v.begin(),v.end()
#define ratoz(v) v.rbegin(),v.rend()
#define Fill(a,v) memset(a,v,sizeof(a))
#define sz(v) v.size()
#define fi first
#define se second
#define inf 1e9
#define pi acos(-1.0)
#define sqr(x) x*x
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define ten(n) (int)1e##n
#define tenll(n) (lli)1e##n

int Set(int N,int pos){return N=N | (1<<pos);}
int reset(int N,int pos){return N= N & ~(1<<pos);}
bool check(int N,int pos){return (bool)(N & (1<<pos));}

int main()
{
    ///freopen("debug.txt","w",stdout);
    /*
     ios_base::sync_with_stdio(false);
    cin.tie(0);
    */
    string s;
    cin>>s;
    lli ans = 1LL , mod = tenll(9) + 7LL;

    map<char,int>mip;

    for(int i=0; i<10; i++) mip[i+'0'] = i;
    int lo = 10;

    for(char c = 'A' ; c<='Z'; c++)mip[c] = lo++;
    for(char c = 'a' ; c<='z'; c++)mip[c] = lo++;

    mip['-'] = lo++;
    mip['_'] = lo;

    for(int i=0; i<sz(s); i++){

        int k = mip[s[i]];

        lli cnt=0LL;

        for(int j=0 ; j<=64 ; j++){

            for(int m = 0; m<=64 ; m++)if( (j&m) == k)cnt++;
        }

        ans *= cnt;

        ans %= mod;

    }
    cout<<ans;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll mod=1e9+7;
int z(char c)
{
	if(c>='0' && c<='9')
		return c-'0';
	if(c>='A' && c<='Z')
		return c-'A'+10;
	if(c>='a' && c<='z')
		return c-'a'+36;
	if(c=='-')
		return 62;
	if(c=='_')
		return 63;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	char c;
	string s;
	cin>>s;
	ll ln=s.length();
	ll a=1;
	for(ll i=0;i<ln;i++)
	{

		ll x=z(s[i]);
		for(int i=0;i<6;i++)
			if(!((x>>i)&1))
				a=a*3%mod;
	}
	cout<<a<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll mod=1e9+7;
int z(char c)
{
	if(c>='9' && c<='0')
		return c-'0';
	if(c>='A' && c<='Z')
		return c-'A'+10;
	if(c>='a' && c<='z')
		return c-'a'+36;
	if(c=='-')
		return 62;
	else
		return 63;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	char c;
	cin>>c;
	ll a=1;
	ll x=z(c);
	for(int i=0;i<6;i++)
		if(!((x>>i)&1))
			a=a*3%mod;
	cout<<a<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define forn(i, n) for(ll i = 0; i < (ll)n; i++)
#define fornn(i, q, n) for(ll i = (ll)q; i < (ll)n; i++)
#define parr(arr,n) for(ll i=0;i<n;i++){cout << arr[i] << " ";} cout<<endl;
#define fore(i, x) for(__typeof((x).begin()) i = (x).begin(); i != (x).end(); i ++)
#define mem(x,val) memset((x),(val),sizeof(x));
#define pb push_back
#define mp make_pair
#define p push
#define f front
#define F first
#define S second
#define pvec(vec) for(ll i=0;i<vec.size();i++){cout<<vec[i]<<" ";} cout<<endl;
#define INF 2000000000
#define MOD 1000000007
const ll maxn=2e5 + 4;
const ll MAXN=1000001;

// #define LocalHost

ll power (ll x, unsigned int y)
{
    ll temp;
    if (y == 0)
        return 1;

    temp = power (x, y / 2);
    if ((y % 2) == 0)
        return (temp * temp)%MOD;
    else
        return (x * temp * temp)%MOD;
}

ll getNum(char c){
    if(c>='0' && c<='9')return ll(c-'0');
    if(c>='A' && c<='Z')return ll(c-'A'+10);
    if(c>='a' && c<='z')return ll(c-'a'+36);
    if(c=='-')return 62;
    if(c=='_')return 63;
}

ll getZeroes(ll num){
    ll ret=0;
    ll p=2;
    ll i=0;
    while(i++<6){
        if(num%2==0)ret++;
        num=num/2;
    }
    return ret;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);

    string s;
    vll v;
    ll num;
    cin>>s;
    forn(i,s.size()){
        v.pb(getNum(s[i]));
        num+=getZeroes(v[v.size()-1]);

    }
    cout<<power(3,num)<<endl;

    #ifdef LocalHost
    printf("TIME: %.3lf\n",double(clock())/CLOCKS_PER_SEC);
    #endif

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define forn(i, n) for(ll i = 0; i < (ll)n; i++)
#define fornn(i, q, n) for(ll i = (ll)q; i < (ll)n; i++)
#define parr(arr,n) for(ll i=0;i<n;i++){cout << arr[i] << " ";} cout<<endl;
#define fore(i, x) for(__typeof((x).begin()) i = (x).begin(); i != (x).end(); i ++)
#define mem(x,val) memset((x),(val),sizeof(x));
#define pb push_back
#define mp make_pair
#define p push
#define f front
#define F first
#define S second
#define pvec(vec) for(ll i=0;i<vec.size();i++){cout<<vec[i]<<" ";} cout<<endl;
#define INF 2000000000
#define MOD 1000000007
const ll maxn=2e5 + 4;
const ll MAXN=1000001;

// #define LocalHost

ll power (ll x, unsigned int y)
{
    ll temp;
    if (y == 0)
        return 1;

    temp = power (x, y / 2);
    if ((y % 2) == 0)
        return (temp * temp)%MOD;
    else
        return (x * temp * temp)%MOD;
}

ll getNum(char c){
    if(c>='0' && c<='9')return ll(c-'0');
    if(c>='A' && c<='Z')return ll(c-'A'+10);
    if(c>='a' && c<='z')return ll(c-'a'+36);
    if(c=='-')return 62;
    if(c=='_')return 63;
}

ll getZeroes(ll num){
    ll ret=0;
    ll p=2;
    ll i=0;
    while(i++<6){
        if(num%2==0)ret++;
        num=num/2;
    }
    return ret;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);

    string s;
    ll num;
    cin>>s;
    num=0;
    forn(i,s.size()){
        num+=getZeroes(getNum(s[i]));
    }
    cout<<power(3,num)<<endl;

    #ifdef LocalHost
    printf("TIME: %.3lf\n",double(clock())/CLOCKS_PER_SEC);
    #endif

	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
map<char,ll> m;
vector <char> v;
ll ans[100];
int main(){
	ll sc=1;
	for(ll i=0;i<10;i++)v.push_back(i+'0');
	for(ll i=0;i<26;i++)v.push_back(i+'A');
	for(ll i=0;i<26;i++)v.push_back(i+'a');
	v.push_back('-');v.push_back('_');
	for(ll i=0;i<64;i++){
		for(ll j=0;j<64;j++){
			for(ll k=0;k<64;k++){
				if((j&k)==i)ans[i]++;
			}
		}
	}
	for(ll i=0;i<64;i++){
		m[v[i]]=i;
	}
	string s;
	cin>>s;
	for(ll i=0;i<s.size();i++){
		sc*=ans[m[s[i]]];
		sc%=1000000007;
	}
	cout<<sc;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
map<char,ll> m;
vector <char> v;
ll ans[100];
int main(){
	ll sc=1;
	for(ll i=0;i<10;i++)v.push_back(i+'0');
	for(ll i=0;i<26;i++)v.push_back(i+'A');
	for(ll i=0;i<26;i++)v.push_back(i+'a');
	v.push_back('-');v.push_back('_');
	for(ll i=0;i<64;i++){
		for(ll j=0;j<64;j++){
			for(ll k=0;k<64;k++){
				ans[i]+=((j&k)==i);
			}
		}
	}
	for(ll i=0;i<64;i++){
		m[v[i]]=i;
	}
	string s;
	cin>>s;
	for(ll i=0;i<s.size();i++){
		sc*=ans[m[s[i]]];
		sc%=1000000009;
	}
	cout<<sc;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
map<char,ll> m;
vector <char> v;
ll ans[100];
int main(){
	ll sc=1;
	for(ll i=0;i<10;i++)v.push_back(i+'0');
	for(ll i=0;i<26;i++)v.push_back(i+'A');
	for(ll i=0;i<26;i++)v.push_back(i+'a');
	v.push_back('-');v.push_back('_');
	for(ll i=0;i<64;i++){
		for(ll j=0;j<64;j++){
			for(ll k=0;k<64;k++){
				if((j&k)==i)ans[i]++;
			}
		}
	}
	for(ll i=0;i<64;i++){
		m[v[i]]=i;
	}
	string s;
	cin>>s;
	for(ll i=0;i<s.size();i++){
		sc*=ans[m[s[i]]];
		cout<<m[s[i]]<<'\n';
		sc%=1000000007;
	}
	cout<<sc;
	return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <numeric>
#include <iterator>
#include <algorithm>
#include <cmath>
#include <chrono>
#include <cassert>

using namespace std;
using ll = long long;
using ld = long double;
using ii = pair<ll, ll>;
using vi = vector<ll>;
using vb = vector<bool>;
using vvi = vector<vi>;
using vii = vector<ii>;
using vvii = vector<vii>;

const int INF = 2000000000;
const ll LLINF = 9000000000000000000;

ll val(char c) {
	if (c >= '0' && c <= '9') return c-'0';
	if (c >= 'A' && c <= 'Z') return 10+c-'A';
	if (c >= 'a' && c <= 'z') return 36+c-'a';
	if (c == '-') return 62;
	return 63;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);

	string s;
	cin >> s;

	ll MOD = 1e9+7;
	ll pw[7];
	pw[0] = 1LL;
	for (int i = 1; i < 7; ++i)
		pw[i] = (pw[i - 1] * 3) % MOD;

	ll ans = 1LL;
	for (size_t i = 0; i < s.size(); ++i) {
		ans = (ans * pw[6 - __builtin_popcountll(val(s[i]))]) % MOD;
	}

	cout << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

int main()
{
    string s;
    cin >>s;

    ll ct[64]={0};
    rep(i,64)rep(j,64) ++ct[i&j];

    rep(i,64) std::cout << ct[i] << std::endl;

    ll ans=1;
    ll mod=1e9+7;
    rep(i,s.size())
    {
        if('0'<=s[i] && s[i]<='9')
        {
            ans*=ct[s[i]-'0'];
            ans%=mod;
        }
        else if('A'<=s[i] && s[i]<='Z')
        {
            ans*=ct[s[i]-'A'+10];
            ans%=mod;
        }
        else if('a'<=s[i] && s[i]<='z')
        {
            ans*=ct[s[i]-'a'+36];
            ans%=mod;
        }
        else if(s[i]=='-')
        {
            ans*=ct[62];
            ans%=mod;
        }
        else
        {
            ans*=ct[63];
            ans%=mod;
        }
    }


#include <bits/stdc++.h>
#define LL long long
using namespace std;

int main() {
	LL x, cnt=0, ans=1;
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(isdigit(s[i])) x = s[i]-'0';
		else if(s[i]>='A' && s[i]<='Z') x = s[i]-'A'+10;
		else if(isalpha(s[i])) x = s[i]-'a'+36;
		else if(s[i]=='-') s[i] = 62;
		else s[i] = 63;
		int bits = 0;
		while(x!=0){
			bits++;
			if(x%2==0) cnt++;
			x/=2;
		}
		cnt += 6-bits;
	}

	for(int i=0;i<cnt;i++){
		ans*=3;
		ans%=1000000007;
	}
	cout<<ans<<endl;

	return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;

int main() {
	LL x, cnt=0, ans=1;
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(isdigit(s[i])) x = s[i]-'0';
		else if(s[i]>='A' && s[i]<='Z') x = s[i]-'A'+10;
		else if(isalpha(s[i])) x = s[i]-'a'+36;
		else if(s[i]=='-') x = 62;
		else x = 63;
		int bits = 0;
		while(x!=0){
			bits++;
			if(x%2==0) cnt++;
			x/=2;
		}
		cnt += 6-bits;
	}

	for(int i=0;i<cnt;i++){
		ans*=3;
		ans%=1000000007;
	}
	cout<<ans<<endl;

	return 0;
}


#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>  //swap function is here
#include <cstring>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;

#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
//__builtin_popcount(n);
#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a) //next three are handy ways to get ints, it's also force you to use '&' sign
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define wez(n) int (n); scanf("%d",&(n)) //handy if the input is right after the definition of a variable
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define TESTS wez(testow)while(testow--) //for multilple cases problems
#define whileZ int T; getI(T); while(T--) // the same as above
#define getS(x) scanf("%s", x) //get a char* string
#define clr(a,x) memset(a,x,sizeof(a)) //set elements of array to some value
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
// for debug
inline void pisz(int n) { printf("%d\n",n); }
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a,L,R) FE(i,L,R) cout << a[i] << (i==R?'\n':' ')
#define printV(a) printA(a,0,a.size()-1)
#define MAXN 10000
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){F(i,0,SZ(t))s<<t[i]<<" ";return s; }

ll mod=1000000007;

ll gcd(ll a,ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

ll power(ll a,ll b,ll m)
{
    ll r=1;
    a=a%m;
    while(b)
    {
        if(b&1)r=r*a%m;
        a=a*a%m;
        b=b>>1;
    }
return r;
}

int main()
{
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif

ios::sync_with_stdio(false);
 cin.tie(0);
 cout.tie(0);

 string str;
 cin >> str;

 std::vector<string> v;

 for (int i = 0; i < str.size(); ++i)
 {
    ll val;
    char ch = str[i];

    if(str[i]>= '0' && str[i]<= '9')
    {
        val = str[i] - '0';
     /* code */
    }
    else if(str[i] >='A' && ch <='Z')
    {
        val = ch - 'A' + 10;
    }
    else if(str[i] >='a' && ch <='z')
    {
        val = ch - 'a' + 36;
    }
    else if( ch == '_')
    {
        val = 63;
    }
    else
    {
        val = 62;
    }
    string s="";

    while(val!=0)
    {
        if(val%2)
        {
            s = "1" + s;
        }
        else
        {
            s = "0" + s;
        }

        val = val/2;
    }

    while(s.size()!=6)
    {
     s = "0" + s;

    }
 //   cout << s << "\n";

    v.push_back(s);
 }

 ll count = 1;
 ll nz = 0;
 ll tap = 1 ;

     for (int j = 0; j < 6; ++j)
    {
        if(v[0][j] == '1')
            tap = 1;
        if(v[0][j] == '0' && tap == 1)
            nz++;

        /* code */
    }

 for (int i = 1; i < v.size(); ++i)
 {
    for (int j = 0; j < 6; ++j)
    {
        if(v[i][j] == '0')
            nz++;
        /* code */
    }
     /* code */
 }

 while(nz)
 {
    count = (count * 3);
    count = count%mod;
    nz--;
 }

cout<< count << "\n";

}


#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>  // istringstream buffer(myString);
#include <stack>
#include <algorithm>  //swap function is here
#include <cstring>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;

#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
//__builtin_popcount(n);
#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a) //next three are handy ways to get ints, it's also force you to use '&' sign
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define wez(n) int (n); scanf("%d",&(n)) //handy if the input is right after the definition of a variable
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define TESTS wez(testow)while(testow--) //for multilple cases problems
#define whileZ int T; getI(T); while(T--) // the same as above
#define getS(x) scanf("%s", x) //get a char* string
#define clr(a,x) memset(a,x,sizeof(a)) //set elements of array to some value
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1]
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end())
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end())
#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
// for debug
inline void pisz(int n) { printf("%d\n",n); }
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a,L,R) FE(i,L,R) cout << a[i] << (i==R?'\n':' ')
#define printV(a) printA(a,0,a.size()-1)
#define MAXN 10000
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){F(i,0,SZ(t))s<<t[i]<<" ";return s; }

ll mod=1000000007;

ll gcd(ll a,ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

ll power(ll a,ll b,ll m)
{
    ll r=1;
    a=a%m;
    while(b)
    {
        if(b&1)r=r*a%m;
        a=a*a%m;
        b=b>>1;
    }
return r;
}

int main()
{
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif

ios::sync_with_stdio(false);
 cin.tie(0);
 cout.tie(0);

 string str;
 cin >> str;

 std::vector<string> v;

 for (int i = 0; i < str.size(); ++i)
 {
    ll val;
    char ch = str[i];

    if(str[i]>=0 && str[i]<=9)
    {
        val = str[i] - '0';
     /* code */
    }
    else if(str[i] >='A' && ch <='Z')
    {
        val = ch - 'A' + 10;
    }
    else if(str[i] >='a' && ch <='z')
    {
        val = ch - 'a' + 36;
    }
    else if( ch == '_')
    {
        val = 63;
    }
    else
    {
        val = 62;
    }
    string s="";

    while(val!=0)
    {
        if(val%2)
        {
            s = "1" + s;
        }
        else
        {
            s = "0" + s;
        }

        val = val/2;
    }

    while(s.size()!=6)
    {
     s = "0" + s;

    }
   // cout << s << "\n";

    v.push_back(s);
 }

 ll count = 1;
 ll nz = 0;
 ll tap = 1 ;

     for (int j = 0; j < 6; ++j)
    {
        if(v[0][j] == '1')
            tap = 1;
        if(v[0][j] == '0' && tap == 1)
            nz++;

        /* code */
    }

 for (int i = 1; i < v.size(); ++i)
 {
    for (int j = 0; j < 6; ++j)
    {
        if(v[i][j] == '0')
            nz++;
        /* code */
    }
     /* code */
 }

 while(nz--)
 {
    count = (count * 3);
    count = count%mod;
 }

cout<< count << "\n";

}


#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

const int N = 1e5 + 10;
char arr[N];
int countt;

int countof(int a) {
    int ret = 0;
    while (a > 0) {
        if (a % 2 == 1)
            ret++;
        a /= 2;
    }
    return ret;
}

ll binaryPower(int base, int pwr, int MOD) {
    if(pwr == 0)
        return 1;
    if (pwr == 1) {
        return base;
    } else if (pwr % 2 == 0) {
        ll val = binaryPower(base, pwr / 2, MOD) % MOD;
        ll ret = val * val;
        ret %= MOD;
        return ret;
    } else {
        ll val = binaryPower(base, pwr / 2, MOD) % MOD;
        ll ret = val * val*base;
        ret %= MOD;
        return ret;
    }
}

int main() {
    scanf(" %s", &arr);
    int sz = strlen(arr);
    //cout << countof('V' - 'A' + 10) << endl;
    for (int i = 0; i < sz; i++) {
        if (arr[i] >= '0' && arr[i] <= '9')
            countt += 6 - countof(arr[i] - '0');
        if (arr[i] >= 'A' && arr[i] <= 'Z')
            countt += 6 - countof(arr[i] - 'A' + 10);
        if (arr[i] >= 'a' && arr[i] <= 'z')
            countt += 6 - countof(arr[i] - 'a' + 36);
        if (arr[i] == '-')
            countt += 6 - countof(62);
        if (arr[i] == '_')
            countt += 6 - countof(63);
    }
    printf("%d", binaryPower(3, countt, 1000000007));

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

const int N = 1e5 + 10;
char arr[N];
int countt;

int countof(int a) {
    int ret = 0;
    while (a > 0) {
        if (a % 2 == 1)
            ret++;
        a /= 2;
    }
    return ret;
}

ll binaryPower(int base, int pwr, int MOD) {
    if (pwr == 1) {
        return base;
    } else if (pwr % 2 == 0) {
        ll val = binaryPower(base, pwr / 2, MOD) % MOD;
        ll ret = val * val;
        ret %= MOD;
        return ret;
    } else {
        ll val = binaryPower(base, pwr / 2, MOD) % MOD;
        ll ret = val * val*base;
        ret %= MOD;
        return ret;
    }
}

int main() {
    scanf(" %s", &arr);
    int sz = strlen(arr);
    //cout << countof('V' - 'A' + 10) << endl;
    for (int i = 0; i < sz; i++) {
        if (arr[i] >= '0' && arr[i] <= '9')
            countt += 6 - countof(arr[i] - '0');
        if (arr[i] >= 'A' && arr[i] <= 'Z')
            countt += 6 - countof(arr[i] - 'A' + 10);
        if (arr[i] >= 'a' && arr[i] <= 'z')
            countt += 6 - countof(arr[i] - 'a' + 36);
        if (arr[i] == '-')
            countt += 6 - countof(62);
        if (arr[i] == '_')
            countt += 6 - countof(63);
    }
    if (countt == 0) {
        return printf("0"), 0;
    }
    printf("%d", binaryPower(3, countt, 1000000007));

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb lower_bound
#define ub upper_bound
#define rep(n) for(int i=0;i<n;i++)
#define rep1(n) for(int j=0;j<n;j++)
#define fori(a,b) for(int i=a;i<=b;i++)

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef map<ll,ll> h;
typedef set<ll,ll> si;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mii;
typedef vector<int>::iterator vit;
typedef vector<ii> vii;
typedef set<ii> sii;
typedef multiset<ii> msii;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int N = 1e5 + 9;

int main()
{
	vector<char> v;
	long value[500]={0};
	string s;
	cin>>s;
	for(char i='0';i<'9';i++)
	v.pb(i);
	for(char i='A';i<='Z';i++)
	v.pb(i);
	for(char i='a';i<='z';i++)
	v.pb(i);
	v.pb('-');
	v.pb('_');
	ll ans=1;
	rep(64)
	value[v[i]]=i+1;
		rep(s.size())
		{
			ll q=value[s[i]];
			rep1(6)
			{
				if((q&(1<<j))==0)
				ans=(ans*3)%MOD;
			}
		}
		cout<<ans<<"\n";
}


#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front;
#define fbo find_by_order
#define ook order_of_key
#define lb lower_bound
#define ub upper_bound
#define rep(n) for(int i=0;i<n;i++)
#define rep1(n) for(int j=0;j<n;j++)
#define fori(a,b) for(int i=a;i<=b;i++)

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef map<ll,ll> h;
typedef set<ll,ll> si;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mii;
typedef vector<int>::iterator vit;
typedef vector<ii> vii;
typedef set<ii> sii;
typedef multiset<ii> msii;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int N = 1e5 + 9;

int main()
{
	vector<char> v;
	long value[500];
	string s;
	cin>>s;
	for(char i='0';i<='9';i++)
	v.pb(i);
	for(char i='A';i<='Z';i++)
	v.pb(i);
	for(char i='a';i<='z';i++)
	v.pb(i);
	v.pb('-');
	v.pb('_');
	ll ans=1;
	rep(64)
	value[v[i]]=i;
		rep(s.size())
		{
			ll q=value[s[i]];
			rep1(6)
			{
				if((q&(1<<j))==0)
				ans=(ans*3)%MOD;
			}
		}
		cout<<ans<<"\n";
}


 /*Header file starts here*/

//#include <bits/stdc++.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cmath>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <climits>
#include <string>
#include <sstream>
#include <cstring>
#include <ctime>

/*Header File ends here*/

/*Macro starts here*/

#define f(i,j,n) for(int i=j; i<n; i++)
#define fu(i,j,n) for(int i=j; i>n; i--)
#define c(x, n) x n; cin>>n
#define ft int t; scanf("%d", &t); for(int c=1; c<=t; c++)
#define w(n) while(n--)
#define visited 1
#define unvisited -1
#define debug printf("\n<<CameHere<<\n")
#define mem(x,y) memset(x, y, sizeof(x))
#define pal(temp) pali(temp, 0, temp.size()-1)
#define nl printf("\n")
#define space printf(" ");
#define eps 1e-9
#define inf 1<<28
#define cases printf("Case %d:", c);
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define min3(a,b,c) min(min(a,b),c)
#define min4(a,b,c,d) min(min(a,b),min(c,d))
#define max3(a,b,c) max(max(a,b),c)
#define max4(a,b,c,d) max(max(a,b),max(c,d))
#define fin freopen("in.txt", "r", stdin)
#define fout freopen("out.txt", "w", stdout)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define gamma 0.57721566490153286060651209008240243
#define PI acos(-1)
#define pi 2*acos(0)
#define cos(a) cos(a*pi/180)
#define sin(a) sin(a*pi/180)
#define tan(a) tan(a*pi/180)
#define cosi(a) acos(a)/(pi/180)
#define sini(a) asin(a)/(pi/180)
#define tani(a) atan(a)/(pi/180)
#define tanii(a,b) atan2(a,b)/(pi/180)//tan(90) = Infinity or a/0
// log(a)=ln(a) base 2.718281828459044979,, log10(a) base 10;
#define powe(a) exp(a)//e^a
//Extended Geometry
#define dis(x1,y1,x2,y2) ((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2))
#define t_area(a,b,c,s) sqrt(s*(s-a)*(s-b)*(s-c))
#define t_angle(a,b,c) cosi((b*b+c*c-a*a)/(2*b*c))

#define deb(x) cerr<< #x <<"="<<x<<endl;

#define si(a) int a; scanf("%d", &a);
#define sll(a) ll a; scanf("%lld", &a);
#define sllu(a) unsigned ll a; scanf("%llu", &a);
#define sd(a) double a; scanf("%lf", &a);

//#define p printf
/*Macro Ends here*/

using namespace std;

/*typedef start here*/

typedef string st;
typedef unsigned long long ll;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <string> vs;
typedef pair <int, int> ii;
typedef vector < pair <int, int> > vii;
typedef priority_queue<int,vector<int>,greater<int> > min_heap;

/*typedef ends here*/

/*Important functions starts here */

template <class T> T abs (T a, T b=0)
{
    if(b==0) return (a<0) ? -a : a;
    return (a>b) ? (a-b) : (b-a);
}

template <class T> inline T gcd(T a, T b)
{
    if(a<0) return gcd(-a, b);
    if(b<0) return gcd(a,-b);
    return (b==0) ? a : gcd(b, a%b);
}

ll xp(ll b, ll n, ll m) {
	ll r = 1;
	while(n > 0) {
		if(n & 1) {
			r = r * b;
			if(r >= m) r %= m;
		}
		n >>= 1;
		b = b * b;
		if(b >= m) b %= m;
	}
	return r % m;
}

ll inv(ll a, ll m){
    return xp(a, m-2, m);
}

bool pali(string temp, int i, int j)
{
    if(i>=j) return true;
    if(temp[i]==temp[j]) return pali(temp, i+1, j-1);
    return false;
}

/*Important functions ends here*/

/*Debug Extension starts here*/

template <typename F, typename S>
ostream& operator << (ostream& os, const pair< F, S>& p)
{
    return os<<"(" <<p.first<<", "<<p.second<<")";
}

template<typename T> ostream &operator << (ostream &os, const vector<T> &v)
{
    os<<"{";
    typename vector<T> :: const_iterator it;
    for(it= v.begin(); it!=v.end(); it++)
    {
        if(it!=v.begin()) os<<",";
        os<<*it;
    }
    return os<<"}";
}

template <typename T> ostream &operator << (ostream & os, const set<T>&v)
{
    os<<"[";
    typename set<T> :: const_iterator it;
    for(it=v.begin(); it!=v.end(); it++)
    {
        if(it!=v.begin()) os<<",";
        os<<*it;
    }
    return os<<"]";
}

template <typename F, typename S> ostream &operator << (ostream & os, const map<F,S>&v)
{
    os<<"[";
    typename map<F,S>::const_iterator it;

    for(it=v.begin(); it!=v.end(); it++)
    {
        if(it != v.begin()) os<<",";
        os<< it ->first<<"="<<it->second;
    }
    return os<<"]";
}

/*Debug Extension ends here*/

ll fact[100002];
ll m=1000000007;
int coun=0;

ll ncr(int n, int r) {
	ll niche=(fact[r]*fact[n-r])%m;
	niche=inv(niche, m);
	ll ans=(fact[n]*niche)%m;
	return ans;
}

void call(char ch){
	int n;
	if(ch>='0' and ch<='9') n=ch-'0';
	else if(ch>='A' and ch<='Z') n=ch-'A'+10;
	else if(ch>='a' and ch<='z') n=ch-'a'+36;
	else if(ch=='-') n=62;
	else n=63;
	//cout<<n<<endl;
	int innercoun=6;
	while(n) {
		innercoun--;
		coun+=(n%2==0);
		n/=2;
	}
	coun+=innercoun;
}

st check="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";

int main(){
	/*f(i,0,64) {
		cout<<i<<" : "<<check[i]<<" ";
		call(check[i]);
	}*/
	fact[0]=fact[1]=1;
	f(i,2,100001) fact[i]=(fact[i-1]*(ll)i)%m;
	//f(i,0,1000) cout<<i<<" : "<<fact[i]<<endl;
	c(st, str);
	int sz=str.size();
	f(i,0,sz) call(str[i]);
	cout<<xp(3, coun, m)<<endl;
return 0;
}