While walking down the street Vanya saw a label "Hide&Seek". Because he is a programmer, he used & as a bitwise AND for these two words represented as a integers in base 64 and got new word. Now Vanya thinks of some string s and wants to know the number of pairs of words of length |s| (length of s), such that their bitwise AND is equal to s. As this number can be large, output it modulo 10^9 + 7.

To represent the string as a number in numeral system with base 64 Vanya uses the following rules:  digits from '0' to '9' correspond to integers from 0 to 9;  letters from 'A' to 'Z' correspond to integers from 10 to 35;  letters from 'a' to 'z' correspond to integers from 36 to 61;  letter '-' correspond to integer 62;  letter '_' correspond to integer 63. 


-----Input-----

The only line of the input contains a single word s (1 ≤ |s| ≤ 100 000), consisting of digits, lowercase and uppercase English letters, characters '-' and '_'.


-----Output-----

Print a single integer — the number of possible pairs of words, such that their bitwise AND is equal to string s modulo 10^9 + 7.


-----Examples-----
Input
z

Output
3

Input
V_V

Output
9

Input
Codeforces

Output
130653412



-----Note-----

For a detailed definition of bitwise AND we recommend to take a look in the corresponding article in Wikipedia.

In the first sample, there are 3 possible solutions:   z&_ = 61&63 = 61 = z  _&z = 63&61 = 61 = z  z&z = 61&61 = 61 = z

Difficulty: interview

Starter code:

Solutions:
MOD = 1000000007

def main():
    opts = [0] * 64
    for i in range(64):
        for j in range(64):
            opts[i & j] += 1

    s = input()
    n = len(s)
    ans = 1
    for c in s:
        if '0' <= c <= '9':
            ans *= opts[ord(c) - ord('0')]
            ans %= MOD
        elif 'A' <= c <= 'Z':
            ans *= opts[ord(c) - ord('A') + 10]
            ans %= MOD
        elif 'a' <= c <= 'z':
            ans *= opts[ord(c) - ord('a') + 36]
            ans %= MOD
        elif c == '-':
            ans *= opts[62]
            ans %= MOD
        else:
            ans *= opts[63]
            ans %= MOD

    print(ans)

main()


s = input()
ans = 1
for x in s:
    if 48<=ord(x)<=57:
        now = int(x)
    elif 65<=ord(x)<=90:
        now = ord(x) - 55
    elif 97<=ord(x)<=122:
        now = ord(x) - 61
    elif x == '-':
        now = 62
    else:
        now = 63
    for i in range(6):
        if now & 2**i == 0:
            ans = (ans*3)%(10**9+7)
    #print(ans)
print(ans)

from string import *
a=[0]*64
for i in range(64):
    for j in range(64):
        a[i&j]+=1
x=1
s=digits+ascii_uppercase+ascii_lowercase+'-_'
for y in input():
    x=x*a[s.index(y)]%1000000007
print(x)


import string
MOD = 1000000007
s = input()
convertion = string.digits + string.ascii_uppercase + string.ascii_lowercase + "-_"
cnt = [0]*64
for val in range(64):
    for x in range(64):
        for y in range(64):
            if (x & y) == val:
                cnt[val] += 1
ans = 1
for c in s:
    ans *= cnt[convertion.find(c)]
    ans %= MOD
print(ans)


#!/usr/bin/env python3

from itertools import chain

data = input()
MOD = 10**9 + 7

translate = [chr(x) for x in chain(list(range(ord('0'), ord('9')+1)),
                                   list(range(ord('A'), ord('Z')+1)),
                                   list(range(ord('a'), ord('z')+1)),
                                   [ord('-'), ord('_')])]
assert len(translate) == 64

translate2 = { k: "{:0>6}".format(bin(i)[2:]).count('0') for i, k in enumerate(translate) }

x = sum([translate2[ch] for ch in data])
print(3**x % MOD)


import string

def zero_count(n):
    return bin(63 - n).count('1')

E = string.digits + string.ascii_uppercase + string.ascii_lowercase + '-_'
D = {c : zero_count(i) for (i,c) in enumerate(E)}

p = 10 ** 9 + 7
s = input().rstrip()
ans = sum(D[c] for c in s)
print(pow(3, ans, p))


def main():
    def f1(c):
        x = ord(c)
        if ord('0') <= x <= ord('9'):
            res = int(c)
        elif ord('A') <= x <= ord('Z'):
            res = x - ord('A') + 10
        elif ord('a') <= x <= ord('z'):
            res = x - ord('a') + 36
        elif c == '-':
            res = 62
        elif c == '_':
            res = 63
        return res

    def f2(x):
        res = bin(x)[2:]
        res = '0' * (6 - len(res)) + res
        return res

    read = lambda: list(map(int, input().split()))
    s = input()
    mod = 10 ** 9 + 7
    n = len(s)
    a = [f2(f1(i)) for i in s]
    t = ''.join(a)
    p = t.count('0')
    ans = 3 ** p % mod
    print(ans)
main()


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

str_in = input()

def decode_char(c):
    if '0' <= c <= '9':
        return ord(c) - ord('0')
    elif 'A' <= c <= 'Z':
        return (ord(c) - ord('A')) + 10
    elif 'a' <= c <= 'z':
        return (ord(c) - ord('a')) + 36
    elif '-' == c:
        return 62
    elif '_' == c:
        return 63
    assert False

result_num = 0
for c in str_in:
    res_str = "{0:06b}".format(decode_char(c))
    result_num += sum(1 for i in res_str if i == '0')

print(pow(3, result_num, 10**9 + 7))


#import sys
#sys.stdin = open("python/in", "r")

s = input()
enc = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
d = dict()
for i in range(len(enc)):
    d[enc[i]] = i
ans = 0
for c in s:
    x = bin(d[c])
    x = x.rjust(8, '0')
    ans += x.count('0') - 1

M0D = 10**9 +7
print(pow(3, ans, M0D))


alth = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"
s = input()
ai = [729,243,243,81,243,81,81,27,243,81,81,27,81,27,27,9,243,81,81,27,81,27,27,9,81,27,27,9,27,9,9,3,243,81,81,27,81,27,27,9,81,27,27,9,27,9,9,3,81,27,27,9,27,9,9,3,27,9,9,3,9,3,3,1]
ans = 1
for i in s:
    ans *= ai[alth.find(i)]
    ans %= 1000000007
print(ans)


def rev(c):
    if c.isdigit():
        return ord(c) - ord('0')
    elif c.isupper():
        return 10 + ord(c) - ord('A')
    elif c.islower():
        return 36 + ord(c) - ord('a')
    elif c == '-':
        return 62
    else:
        return 63

counter = [0] * 64
for i in range(64):
    for j in range(64):
        counter[i & j] += 1
ans = 1
mod = int(1e9+7)
for s in input():
    ans *= counter[rev(s)]
    ans %= mod
print(ans)


cyph = [str(x) for x in range(10)]+[chr(65+i) for i in range(26)]+[chr(97+i) for i in range(26)]+['-']+['_']
dct = {}
def decod(char):
    i = 0
    if char in dct:
        return dct[char]
    else:
        while cyph[i] != char:
            i += 1
        dct[char]=i
        return i
        
dct2 = {}
def zeros(i):
    if i in dct2:
        return dct2[i]
    else:
        cct = 0
        for j in range(6):
            cct += (i >> j) % 2
        dct2[i] = 6 - cct
        return dct2[i]
        
s = input()
cnt = 1
for char in s:
    tmp = decod(char)
    cnt *= (3 ** zeros(tmp))
    cnt %= 1000000007
    
print(cnt)

A = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"
Z = [0] * 64
for i in range(64):
    r = 0
    for j in range(64):
        for k in range(64):
            if i == (j & k):
                r += 1
    Z[i] = r
    #print(str(i) + ".", A[i], "=>", r)

r = 1
for c in input():
    #print("c:", c, "idx:", A.index(c), "z:", Z[A.index(c)])
    r = (r * Z[A.index(c)]) % 1000000007
print(r)

"""
V_V & V_V = V_V

__V & V_V = V_V
V_V & __V = V_V

V__ & V_V = V_V
V_V & V__ = V_V

___ & V_V = V_V
V_V & ___ = V_V

__V & V__ = V_V
V__ & __V = V_V
"""


#from functools import cmp_to_key
#from collections import deque
import math

mod = int(10**9+7)
N = int(1e5)+10

def main():
    d = {}
    for i in range(10):
        d[str(i)] = i
    i = 10
    for j in range(26):
        c = str(chr(ord('A')+j))
        d[c] = i
        i += 1
    for j in range(26):
        c = str(chr(ord('a') + j))
        d[c] = i
        i += 1
    d['-'] = i
    d['_'] = i+1
    s = input()

    ans = 1
    temp = [0 for i in range(64)]
    for i in range(64):
        for j in range(64):
            temp[i&j] += 1
    l = [d[c] for c in s]
    for j in l:
        ans = (temp[j]*ans+mod)%mod
    print(ans)


def __starting_point():
    main()
__starting_point()

s,ans=input(),1
for x in s:
    if '0'<=x<='9': t=ord(x)-48
    if 'A'<=x<='Z': t=ord(x)-55
    if 'a'<=x<='z': t=ord(x)-61
    if x=='-': t=62
    if x=='_': t=63
    ans=ans*(3**(6-bin(t).count('1')))%1000000007
print(ans)

def get_num(sym):
    if sym in '0123456789':
        return int(sym)
    if sym == '-':
        return 62
    if sym == '_':
        return 63
    if ord('a')<=ord(sym)<=ord('z'):
        return ord(sym)-ord('a')+36
    else:
        return ord(sym)-ord('A')+10

def bins(x):
    return bin(x)[2:]
p = 10**9+7
s = input()
ans = 1
for sym in s:
    now = bins(get_num(sym))
    now = '0'*(6-len(now))+now
    for i in now:
        if i is '0':
            ans *= 3
    ans %= p

print(ans)
#print(get_num(s))


def count(num):
    string = bin(num)[2:]
    return string.count('0') + 6 - len(string)

key = [3 ** count(x) for x in range(64)]

dic = {}
for i in range(10):
    dic[chr(ord('0') + i)] = key[i]
for i in range(26):
    dic[chr(ord('A') + i)] = key[i + 10]
for i in range(26):
    dic[chr(ord('a') + i)] = key[i + 36]
dic['-'] = key[62]
dic['_'] = key[63]

mod = int(1e9) + 7
string = input()

ans = 1
for x in string:
    ans = (ans * dic[x]) % mod
print(ans)

import sys

def convert(x):
    if x>='A' and x<='Z':
        return (ord(x)-ord('A'))+10
    if x>='a' and x<='z':
        return (ord(x)-ord('a'))+36
    if x>='0' and x<='9':
        return (ord(x)-ord('0'))
    if x=='-':
        return 62
    return 63

def ones(n):
    r = 0
    while n!=0 :
        n&=n-1
        r+=1
    return r

def zeros(x):
    return 6 - ones(x)

# def zeros(x):
#     i=1 
#     res=0
#     while i<=x:
#         if (i&x) ==0:
#             res+=1
#         i= i<<1
#     return res

def pow (a , b , mod = 10**9+7):
    res = 1
    while b > 0 :
        if (b&1) == 0 :
            a = (a*a) % mod
            b = b>>1
        else:
            res= (res*a) %mod
            b-=1
    return res

def main():
    x = sys.stdin.readline().rstrip()
    t = 0
    for s in x:
        v = convert(s)
        z = zeros(v)
        t+=z

    print(pow(3,t))

main()


table=[]
for i in range(0,64):
    ans=-1
    for z in bin(i):
        if z=='0':
            ans+=1
    table.append(ans+8-len(bin(i)))
s=input()
ans=1
for i in s:
    if i=="_":
        z=63
    elif i=="-":
        z=62
    elif i.isdigit():
        z=int(i)
    elif ord(i)>=97:
        z=ord(i)-97+36
    else:
        z=ord(i)-65+10
    ans*=3**table[z]
    ans%=(10**9+7)
print(ans)


zcount = [6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0]
digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'

s = input()

c = 0

for i in s:
	c += zcount[digits.index(i)]

k = 1

for j in range(c):
	k *= 3
	if k >= 1000000007: k = k % 1000000007

print(k % 1000000007)

z = input()
l = []
for x in z:
	if(ord(x)>=ord('0') and ord(x)<=ord('9')):
		l.append(ord(x)-ord('0'))
	elif(ord(x)>=ord('A') and ord(x)<=ord('Z')):
		l.append(ord(x)-ord('A')+10)
	elif(ord(x)>=ord('a') and ord(x)<=ord('z')):
		l.append(ord(x)-ord('a')+36)
	elif(ord(x)==ord('-')):
		l.append(62)
	else:
		l.append(63)


ans=1
for i in l:
	unset = 6-bin(i).count('1')
	for x in range(unset):
		ans *= 3
		while(ans>=1000000007):
			ans-=1000000007
		# ans%=1000000007
print(ans)

def getLetterNumber(letter):
    if '0' <= letter <= '9':
        return ord(letter) - ord('0')
    if 'A' <= letter <= 'Z':
        return ord(letter) - ord('A') + 10
    if 'a' <= letter <= 'z':
        return ord(letter) - ord('a') + 36
    if letter == '-':
        return 62
    if letter == '_':
        return 63

def getNumberOfVairants(number):
    return 3**"{0:b}".format(number).zfill(6).count('0')

def getNumber(str):
    result = 1;
    for c in str:
        num = getLetterNumber(c)
        result = result * getNumberOfVairants(num)
        result %= (int(1e9) + 7)
    return result

s = input()
print(getNumber(s))

from collections import defaultdict

def __starting_point():
    #n, m = list(map(int, input().split()))
    s = input()
    s1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"
    d = defaultdict(int)
    for i in range(64):
        for j in range(64):
            d[s1[i & j]] += 1
    ans = 1
    for ch in s:
        ans = ans * d[ch] % (10 ** 9 + 7)

    print(ans)
__starting_point()