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: MEDIUM

Solutions:
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)


s = input().strip()
m = {}
for i in range(10):
	m[str(i)] = i
for i in range(ord('Z') - ord('A') + 1):
	m[chr(ord('A') + i)] = 10 + i
for i in range(ord('z') - ord('a') + 1):
	m[chr(ord('a') + i)] = 36 + i
m['-'] = 62
m['_'] = 63
zero_bits = 0
for c in s:
	n = m[c]
	for i in range(6):
		zero_bits += int(not n & 1)
		n >>= 1
res = 1
for z in range(zero_bits):
	res = res * 3 % 1000000007
print(res)


mod = 10 ** 9 + 7
resp = 1
s = input()

def between(n, a, b):
	return n >= a and n <= b
for i in s:
	if between(i, '0', '9'):
		i = ord(i) - ord('0')
	elif between(i, 'A', 'Z'):
		i = ord(i) - ord('A') + 10
	elif between(i, 'a', 'z'):
		i = ord(i) - ord('a') + 36
	elif i == '-':
		i = 62
	else:
		i = 63
	for j in range(6):
		if i >> j & 1 == 0:
			resp = 3 * resp % mod
print(resp)


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))


s = input()
ans = [0 for i in range(64)]
for i in range(len(ans)):
	temp = bin(i)
	ans[i] = temp.count('0') - 1 + (6 - (len(temp) - 2))
pri = 10 ** 9 + 7
count = 1
for i in range(len(s)):
	if s[i].isdigit():
		r = bin(int(s[i]))
		r = r[2:]
		count = count * pow(3, ans[int(s[i])], pri)
		count %= pri
	elif s[i] == '-':
		count = count * pow(3, ans[62], pri)
		count %= pri
	elif s[i] == '_':
		count = count * pow(3, ans[63], pri)
		count %= pri
	elif 65 <= ord(s[i]) <= 91:
		count = count * pow(3, ans[ord(s[i]) - 65 + 10], pri)
		count %= pri
	elif 97 <= ord(s[i]) <= 122:
		count = count * pow(3, ans[ord(s[i]) - 97 + 36], pri)
		count %= pri
print(count % pri)


(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)


chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
d = {}
cnt = 0
for i in chars:
	d[i] = cnt
	cnt += 1
s = input()
ans = 1
mod = 10 ** 9 + 7
for i in s:
	x = bin(d[i])
	x = x.split('b')
	x = x[1]
	p = 0
	for j in x:
		if j == '0':
			ans = ans * 3 % mod
		p += 1
	ans = ans * 3 ** (6 - p) % mod
print(ans)


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()


from math import log

def f(s):
	s = s[::-1]
	a = {}
	cons = 0
	for i in range(10):
		a[str(i)] = cons
		cons += 1
	for i in 'abcdefghijklmnopqrstuvwxyz'.upper():
		a[i] = cons
		cons += 1
	for i in 'abcdefghijklmnopqrstuvwxyz':
		a[i] = cons
		cons += 1
	a['-'] = 62
	a['_'] = 63
	ans = 1
	for i in s:
		pp = a[i]
		tc = bin(a[i]).lstrip('0b')
		tc = '0' * (6 - len(tc)) + tc
		ans *= 3 ** tc.count('0')
		ans %= 10 ** 9 + 7
	return ans
print(f(input()))


def main():
	s = input()
	number = ''
	ans = 1
	for c in s:
		if c >= '0' and c <= '9':
			number = bin(int(c))[2:]
		elif c >= 'A' and c <= 'Z':
			number = bin(ord(c) - 55)[2:]
		elif c >= 'a' and c <= 'z':
			number = bin(ord(c) - 61)[2:]
		elif c == '-':
			number = bin(62)[2:]
		else:
			number = bin(63)[2:]
		if len(number) < 6:
			diff = 6 - len(number)
			for i in range(diff):
				number += '0'
		for digit in number:
			if digit == '0':
				ans = ans * 3 % 1000000007
	print(ans)
main()


s = input()
freq = [0] * 64
for i in range(64):
	for j in range(64):
		freq[i & j] += 1
mod = 10 ** 9 + 7
ans = 1
for i in s:
	if '0' <= i <= '9':
		b = int(i)
	elif 'A' <= i <= 'Z':
		b = ord(i) - ord('A') + 10
	elif 'a' <= i <= 'z':
		b = ord(i) - ord('a') + 36
	elif i == '-':
		b = 62
	else:
		b = 63
	ans *= freq[b]
	ans %= mod
print(ans)


import sys
chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
mp = {}
for i in range(len(chars)):
	mp[chars[i]] = i
zero = 0
s = sys.stdin.readline()
for i in range(len(s) - 1):
	zero += sum([i == '0' for i in format(mp[s[i]], '06b')])
print(pow(3, zero, int(1000000000.0 + 7)))


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
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)


import math
mod = int(10 ** 9 + 7)
N = int(100000.0) + 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)
main()


def Bina(n):
	s = ''
	while n != 0:
		s += str(n % 2)
		n = n // 2
	return s

def Zeros(b):
	ones = 0
	for i in range(b.__len__()):
		if '1' == b[i]:
			ones += 1
	return 6 - ones
total = 1
alphabet = list('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-')
dic = {}
num = 0
for i in alphabet:
	dic[i] = Zeros(Bina(alphabet.index(i)))
M = int(1000000000.0 + 7)
for i in input():
	if i == '_':
		continue
	num = dic[i]
	total = total * 3 ** num % M
print(total)


mod = 1000000007
resp = 1

def between(c, l, r):
	return ord(c) >= ord(l) and ord(c) <= ord(r)
s = input()
for i in s:
	if between(i, '0', '9'):
		i = ord(i) - ord('0')
	elif between(i, 'A', 'Z'):
		i = ord(i) - ord('A') + 10
	elif between(i, 'a', 'z'):
		i = ord(i) - ord('a') + 36
	elif i == '-':
		i = 62
	else:
		i = 63
	for j in range(6):
		if i >> j & 1 == 0:
			resp = 3 * resp % mod
print(resp)


import sys
import math

def bitfield(n):
	return [int(digit) for digit in bin(n)[2:]]

def getzeros(n):
	result = 0
	bf = bitfield(n)
	for i in bf:
		if i == 0:
			result += 1
	result += 6 - len(bf)
	return result

def getnum(ch):
	if ord(ch) == ord('-'):
		return 62
	if ord(ch) == ord('_'):
		return 63
	if ord(ch) - ord('0') <= 9:
		return ord(ch) - ord('0')
	if 10 + ord(ch) - ord('A') <= 35:
		return 10 + ord(ch) - ord('A')
	if 36 + ord(ch) - ord('a') <= 61:
		return 36 + ord(ch) - ord('a')
combinations = dict()
for i in '0123456789':
	combinations[i] = 3 ** getzeros(getnum(i))
for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
	combinations[i] = 3 ** getzeros(getnum(i))
for i in 'abcdefghijklmnopqrstuvwxyz':
	combinations[i] = 3 ** getzeros(getnum(i))
combinations['-'] = 3 ** getzeros(getnum('-'))
combinations['_'] = 3 ** getzeros(getnum('_'))
word = input()
result = 1
for i in word:
	result = result * combinations[i] % 1000000007
print(result)


from string import ascii_lowercase, ascii_uppercase
from collections import defaultdict
idx = ''
for i in range(10):
	idx += str(i)
idx += ascii_uppercase
idx += ascii_lowercase
idx += '-_'
md = 10 ** 9 + 7
vals = defaultdict(list)
for i in range(64):
	for j in range(64):
		el1 = idx[i]
		el2 = idx[j]
		res = i & j
		elres = idx[res]
		vals[elres].append([el1, el2])
s = input()
ans = 1
for i in s:
	ans = ans % md * (len(vals[i]) % md) % md
print(ans)


import string
symbol = ''.join(map(str, range(10))) + string.ascii_uppercase + string.ascii_lowercase + '-_'
d = dict([(symbol[i], i) for i in range(len(symbol))])
s = input()
ans = 1
for i in s:
	for j in range(6):
		if d[i] & 1 << j == 0:
			ans = ans * 3 % 1000000007
print(ans)


from collections import defaultdict
import sys
input = sys.stdin.readline
print = sys.stdout.write
s = input()
d = {}
for i in range(0, 10):
	d[i] = str(i)
for i in range(10, 36):
	d[i] = chr(i + 55)
for i in range(36, 62):
	d[i] = chr(i + 61)
d[62] = '-'
d[63] = '_'
rep = defaultdict(int)
for j in range(64):
	for k in range(64):
		rep[d[j & k]] += 1
mod = 10 ** 9 + 7
ans = 1
for i in range(len(s) - 1):
	ans = ans * rep[s[i]] % mod
print(str(ans))


from collections import defaultdict
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)


s = input()
m = dict()
a = dict()
m['-'] = 62
m['_'] = 63
for i in range(10):
	m[str(i)] = i
for i in range(26):
	m[chr(65 + i)] = 10 + i
for i in range(26):
	m[chr(97 + i)] = 36 + i
for x in range(64):
	for j in range(64):
		a[x & j] = a.get(x & j, 0) + 1
ans = 1
for c in s:
	ans = ans * a.get(m[c], 0) % 1000000007
print(ans)


word = input()
count = 0
for s in word:
	count = count - 2
	if s == '0':
		count += 8
	elif s == '1':
		count += 7
	elif s == '2':
		count += 7
	elif s == '3':
		count += 6
	elif s == '4':
		count += 7
	elif s == '5':
		count += 6
	elif s == '6':
		count += 6
	elif s == '7':
		count += 5
	elif s == '8':
		count += 7
	elif s == '9':
		count += 6
	elif s == 'A':
		count += 6
	elif s == 'B':
		count += 5
	elif s == 'C':
		count += 6
	elif s == 'D':
		count += 5
	elif s == 'E':
		count += 5
	elif s == 'F':
		count += 4
	elif s == 'G':
		count += 7
	elif s == 'H':
		count += 6
	elif s == 'I':
		count += 6
	elif s == 'J':
		count += 5
	elif s == 'K':
		count += 6
	elif s == 'L':
		count += 5
	elif s == 'M':
		count += 5
	elif s == 'N':
		count += 4
	elif s == 'O':
		count += 6
	elif s == 'P':
		count += 5
	elif s == 'Q':
		count += 5
	elif s == 'R':
		count += 4
	elif s == 'S':
		count += 5
	elif s == 'T':
		count += 4
	elif s == 'U':
		count += 4
	elif s == 'V':
		count += 3
	elif s == 'W':
		count += 7
	elif s == 'X':
		count += 6
	elif s == 'Y':
		count += 6
	elif s == 'Z':
		count += 5
	elif s == 'a':
		count += 6
	elif s == 'b':
		count += 5
	elif s == 'c':
		count += 5
	elif s == 'd':
		count += 4
	elif s == 'e':
		count += 6
	elif s == 'f':
		count += 5
	elif s == 'g':
		count += 5
	elif s == 'h':
		count += 4
	elif s == 'i':
		count += 5
	elif s == 'j':
		count += 4
	elif s == 'k':
		count += 4
	elif s == 'l':
		count += 3
	elif s == 'm':
		count += 6
	elif s == 'n':
		count += 5
	elif s == 'o':
		count += 5
	elif s == 'p':
		count += 4
	elif s == 'q':
		count += 5
	elif s == 'r':
		count += 4
	elif s == 's':
		count += 4
	elif s == 't':
		count += 3
	elif s == 'u':
		count += 5
	elif s == 'v':
		count += 4
	elif s == 'w':
		count += 4
	elif s == 'x':
		count += 3
	elif s == 'y':
		count += 4
	elif s == 'z':
		count += 3
	elif s == '-':
		count += 3
	elif s == '_':
		count += 2
print(3 ** count % 1000000007)


s = input()
v = []
for l in s:
	if 48 <= ord(l) <= 57:
		v.append(ord(l) - 48)
	elif 65 <= ord(l) <= 90:
		v.append(ord(l) - 55)
	elif 97 <= ord(l) <= 122:
		v.append(ord(l) - 61)
	elif l == '-':
		v.append(62)
	elif l == '_':
		v.append(63)
assert len(v) == len(s)
mods = [0] * 64
for i in range(64):
	for j in range(64):
		mods[i & j] += 1
(ans, MOD) = (1, 10 ** 9 + 7)
for x in v:
	ans *= mods[x]
	ans %= MOD
print(ans)


d = {}
for i in range(10):
	temp = i
	bits = 0
	while temp > 0:
		if temp & 1:
			bits += 1
		temp = temp >> 1
	d[str(i)] = 6 - bits
curr = 10
for i in range(26):
	temp = curr
	bits = 0
	while temp > 0:
		if temp & 1:
			bits += 1
		temp = temp >> 1
	d[chr(ord('A') + i)] = 6 - bits
	curr += 1
for i in range(26):
	temp = curr
	bits = 0
	while temp > 0:
		if temp & 1:
			bits += 1
		temp = temp >> 1
	d[chr(ord('a') + i)] = 6 - bits
	curr += 1
d['-'] = 6 - 5
d['_'] = 6 - 6
s = input()
ans = 1
for i in s:
	ans = ans * 3 ** d[i] % (10 ** 9 + 7)
print(ans % (10 ** 9 + 7))


from collections import defaultdict

def convert(x):
	val = 0
	if x >= '0' and x <= '9':
		val = int(x)
	if x >= 'A' and x <= 'Z':
		val = ord(x) - ord('A')
		val += 10
	if x >= 'a' and x <= 'z':
		val = ord(x) - ord('a')
		val += 36
	if x == '-':
		val = 62
	if x == '_':
		val = 63
	return val
S = input()
words = []
MOD = 10 ** 9 + 7
cnt = defaultdict(int)
for x in range(10):
	words.append(str(x))
for x in range(ord('A'), ord('Z') + 1):
	words.append(chr(x))
for x in range(ord('a'), ord('z') + 1):
	words.append(chr(x))
words.append('-')
words.append('_')
for x in range(len(words)):
	for y in range(len(words)):
		if x == y:
			val = x & y
			cnt[val] += 1
		else:
			val = x & y
			cnt[val] += 1
result = 1
for x in S:
	val = convert(x)
	tmp = cnt[val]
	result *= tmp
	result %= MOD
print(result % MOD)


from math import factorial
b = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6]
d = {'N': 23, '9': 9, 'g': 42, '3': 3, '4': 4, 'Q': 26, 'K': 20, 'S': 28, 'A': 10, 'x': 59, 'B': 11, 'I': 18, 'n': 49, '7': 7, '-': 62, 'J': 19, 'm': 48, '5': 5, 'O': 24, 'L': 21, 'u': 56, 'r': 53, 'Z': 35, 'M': 22, 'j': 45, 'v': 57, 'q': 52, 'X': 33, 't': 55, 'a': 36, 's': 54, 'z': 61, 'Y': 34, 'd': 39, 'p': 51, 'o': 50, 'f': 41, 'P': 25, 'V': 31, '_': 63, 'w': 58, 'C': 12, 'R': 27, 'b': 37, 'E': 14, '0': 0, 'G': 16, 'k': 46, 'l': 47, 'D': 13, 'W': 32, 'T': 29, '8': 8, 'U': 30, 'F': 15, '2': 2, 'c': 38, 'h': 43, 'y': 60, 'i': 44, 'e': 40, '6': 6, 'H': 17, '1': 1}
MOD = 1000000000.0 + 7
max_dig = 6
ans = 1
s = input()
for c in s:
	nul_num = max_dig - b[d[c]]
	ans *= 3 ** nul_num
	ans %= MOD
print(int(ans))


def ordd(s):
	if s == '-':
		return 62
	elif s == '_':
		return 63
	elif s in '0123456789':
		return int(s)
	elif ord('a') <= ord(s) <= ord('z'):
		return ord(s) - 61
	elif ord('A') <= ord(s) <= ord('Z'):
		return ord(s) - 55
s = input()
b = ''
res = 1
h = ''
for i in range(0, len(s)):
	h = bin(ordd(s[i]))[2:]
	d = '0' * (6 - len(h))
	b += d + h
print(3 ** b.count('0') % (10 ** 9 + 7))


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 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()


s = input()
MOD = 10 ** 9 + 7
a = {}
b = []
k = 0
for i in range(ord('0'), ord('9') + 1):
	a[chr(i)] = k
	k += 1
	b.append(chr(i))
for i in range(ord('A'), ord('Z') + 1):
	a[chr(i)] = k
	k += 1
	b.append(chr(i))
for i in range(ord('a'), ord('z') + 1):
	a[chr(i)] = k
	k += 1
	b.append(chr(i))
(a['-'], a['_']) = (62, 63)
b.append('-')
b.append('_')
cnt = {}
for i in b:
	cnt[i] = 0
for i in b:
	for j in b:
		cnt[b[a[i] & a[j]]] += 1
ans = 1
for i in s:
	ans = ans * cnt[i] % MOD
print(ans)


d = [0] * 64
for i in range(64):
	for j in range(64):
		d[i & j] += 1
s = input()
ans = 1
for i in s:
	if '0' <= i <= '9':
		ans *= d[int(i)]
	elif 'A' <= i <= 'Z':
		ans *= d[ord(i) - ord('A') + 10]
	elif 'a' <= i <= 'z':
		ans *= d[ord(i) - ord('a') + 10 + 26]
	elif i == '-':
		ans *= d[62]
	elif i == '_':
		ans *= d[63]
	ans %= 10 ** 9 + 7
print(ans)


mod = int(1000000000.0) + 7
between = lambda x, y, z: ord(x) >= ord(y) and ord(x) <= ord(z)
s = input()
r = 1
for i in s:
	if between(i, '0', '9'):
		i = ord(i) - ord('0')
	elif between(i, 'A', 'Z'):
		i = ord(i) - ord('A') + 10
	elif between(i, 'a', 'z'):
		i = ord(i) - ord('a') + 36
	elif i == '-':
		i = 62
	else:
		i = 63
	for j in range(6):
		if i >> j & 1 == 0:
			r = 3 * r % mod
print(r)


num = list(range(10))
bword = list(range(10, 36))
sword = list(range(36, 62))
bigconst = 65
smallconst = 97
ans = 1
s = input()
for i in range(len(s)):
	if s[i] >= '0' and s[i] <= '9':
		k = int(s[i])
	elif s[i] >= 'A' and s[i] <= 'Z':
		k = bword[ord(s[i]) - bigconst]
	elif s[i] >= 'a' and s[i] <= 'z':
		k = sword[ord(s[i]) - smallconst]
	elif s[i] == '-':
		k = 62
	else:
		k = 63
	k = bin(k)
	ans = ans * 3 ** (k.count('0') - 1 + (6 - (len(k) - 2))) % (10 ** 9 + 7) % (10 ** 9 + 7)
print(ans % (10 ** 9 + 7))


x = input()
a = []
for c in x:
	if 48 <= ord(c) <= 57:
		a.append(ord(c) - 48)
	elif 65 <= ord(c) <= 90:
		a.append(ord(c) - 55)
	elif 97 <= ord(c) <= 122:
		a.append(ord(c) - 61)
	elif c == '-':
		a.append(62)
	elif c == '_':
		a.append(63)
m = 10 ** 9 + 7
ans = 1
for num in a:
	for c in '{0:06b}'.format(num):
		if c == '0':
			ans *= 3
			ans %= m
print(ans)


from functools import reduce
s = input()
m = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
d = {}
for i in range(len(m)):
	b = bin(i).replace('0b', '')
	d[m[i]] = 3 ** (6 - len(b) + b.count('0'))
k = 10 ** 9 + 7
print(reduce(lambda x, y: x * y % k, [d[c] for c in s], 1) % k)


s = input()
chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
counts = [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]
s_counts = [None] * 64
for i in range(64):
	s_counts[i] = s.count(chars[i])
result = 1
for i in range(64):
	result *= counts[i] ** s_counts[i]
print(result % (10 ** 9 + 7))


def main():
	l = [0] * 123
	for (i, c) in enumerate('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'):
		l[ord(c)] = '{:0>6b}'.format(i).count('0')
	print(pow(3, sum((l[ord(c)] for c in input())), 1000000007))
main()


def str_to_array(s):
	array = [None] * len(s)
	for (i, c) in enumerate(s):
		code = ord(c)
		if 48 <= code <= 57:
			array[i] = code - 48
		elif 65 <= code <= 90:
			array[i] = code - 55
		elif 97 <= code <= 122:
			array[i] = code - 61
		elif code == 45:
			array[i] = 62
		elif code == 95:
			array[i] = 63
	return array

def calculate_for_one_number(number):
	r = 1
	for _ in range(6):
		digit = number & 1
		if digit == 0:
			r *= 3
		number >>= 1
	return r
inp = str_to_array(input())
result = 1
for n in inp:
	result *= calculate_for_one_number(n)
	result %= 1000000007
print(result)


d = {}

def init():
	l = []
	for item in range(10):
		l.append(str(item))
	for item in range(ord('A'), ord('Z') + 1):
		l.append(chr(item))
	for item in range(ord('a'), ord('z') + 1):
		l.append(chr(item))
	l.append('-')
	l.append('_')
	for (i, item) in enumerate(l):
		d[item] = '{0:06b}'.format(i).count('0')
init()
ret = 0
for item in input():
	ret += d[item]
print(3 ** ret % (10 ** 9 + 7))


conversaoBase64 = {'-': 62, '_': 63}
for j in range(0, 10):
	conversaoBase64[str(j)] = j
j = 10
for i in range(ord('A'), ord('Z') + 1):
	conversaoBase64[chr(i)] = j
	j += 1
j = 36
for i in range(ord('a'), ord('z') + 1):
	conversaoBase64[chr(i)] = j
	j += 1
palavra = list(input())
cont = 0
for letra in palavra:
	letraBase64 = conversaoBase64[letra]
	for i in range(6):
		if letraBase64 >> i & 1 == 0:
			cont += 1
c = 1000000007
print(3 ** cont % c)


print(3 ** sum((6 - bin({'-': 62, '_': 63}.get(c, ord(c) - 7 * (c > '9') - 6 * (c > 'Z') - 48)).count('1') for c in input())) % 1000000007)


def toi(c):
	if c >= '0' and c <= '9':
		return ord(c) - ord('0')
	if c >= 'A' and c <= 'Z':
		return ord(c) - ord('A') + 10
	if c >= 'a' and c <= 'z':
		return ord(c) - ord('a') + 36
	if c == '-':
		return 62
	if c == '_':
		return 63
s = input()
q = [0] * 64
for i in range(64):
	for j in range(64):
		q[i & j] += 1
r = 1
for c in s:
	r *= q[toi(c)]
	r %= 1000000007
print(r)


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()


import sys
read = lambda : sys.stdin.readline().strip()
readi = lambda : map(int, read().split())
from collections import *
import string
mapping = dict()
for key in string.digits:
	mapping[key] = int(key)
start = 10
for key in string.ascii_uppercase:
	mapping[key] = start
	start += 1
for key in string.ascii_lowercase:
	mapping[key] = start
	start += 1
mapping['-'] = 62
mapping['_'] = 63

def getCount(num):
	count = 0
	num = ~num
	for i in range(6):
		if num & 1 == 1:
			count += 1
		num = num >> 1
	return count
for key in mapping.keys():
	mapping[key] = getCount(mapping[key])
s = read()
ans = 1
mod = 10 ** 9 + 7
for key in s:
	ans = ans * 3 ** mapping[key] % mod
print(ans)


x = 10 ** 9 + 7
y = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
s = input()
count = 0
for i in s:
	b = bin(int(y.find(i)))[2:]
	count += b.zfill(6).count('0')
print(3 ** count % x)


def numZero(x):
	cnt = 0
	for i in range(6):
		if x & 1 << i == 0:
			cnt += 1
	return cnt
bits = list('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_')
nums = [i for i in range(64)]
dicts = dict(zip(bits, nums))
s = input()
total = 1
for c in s:
	t = dicts[c]
	zeros = numZero(t)
	total = total * 3 ** zeros % (10 ** 9 + 7)
print(total)


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)


import sys
import bisect
try:
	fin = open('in')
except:
	fin = sys.stdin
input = lambda : fin.readline().strip()
s = input()
r = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
t = sum((6 - bin(r.index(u)).count('1') for u in s))
ans = 1
mod = 10 ** 9 + 7
a = 3
while t:
	if t & 1:
		ans = ans * a % mod
	a = a * a % mod
	t >>= 1
print(ans)


ls = [0] * 100010
for i in range(64):
	for j in range(64):
		ls[i & j] += 1
s = input()
ss = 1
for i in s:
	if ord(i) >= ord('a') and ord(i) <= ord('z'):
		ss *= ls[ord(i) - ord('a') + 36]
	elif ord(i) >= ord('A') and ord(i) <= ord('Z'):
		ss *= ls[ord(i) - ord('A') + 10]
	elif ord(i) >= ord('0') and ord(i) <= ord('9'):
		ss *= ls[ord(i) - ord('0')]
	elif i == '-':
		ss *= ls[62]
	elif i == '_':
		ss *= ls[63]
	ss %= 10 ** 9 + 7
print(ss)


def conv(d):
	if '0' <= d <= '9':
		return int(d)
	if 'A' <= d <= 'Z':
		return 10 + ord(d) - ord('A')
	if 'a' <= d <= 'z':
		return 36 + ord(d) - ord('a')
	if d == '-':
		return 62
	return 63
cnt = [0] * 64
for a in range(64):
	for b in range(64):
		cnt[a & b] += 1
ans = 1
for d in input():
	ans = ans * cnt[conv(d)] % (10 ** 9 + 7)
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)


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(1000000000.0 + 7)
for s in input():
	ans *= counter[rev(s)]
	ans %= mod
print(ans)


def get(s):
	try:
		return int(s)
	except:
		if s == '-':
			return 62
		elif s == '_':
			return 63
		elif s.isupper():
			return ord(s) - 55
		else:
			return ord(s) - 61
arr = [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]
st = input()
count = 0
for i in range(len(st)):
	x = get(st[i])
	count += arr[x]
print(3 ** count % (10 ** 9 + 7))


def is_between(c, l, r):
	return ord(c) >= ord(l) and ord(c) <= ord(r)

def solve(letters, mod):
	result = 1
	for i in letters:
		if is_between(i, '0', '9'):
			i = ord(i) - ord('0')
		elif is_between(i, 'A', 'Z'):
			i = ord(i) - ord('A') + 10
		elif is_between(i, 'a', 'z'):
			i = ord(i) - ord('a') + 36
		elif i == '-':
			i = 62
		else:
			i = 63
		for j in range(6):
			if i >> j & 1 == 0:
				result = 3 * result % mod
	return result
mod = 1000000007
letters = input()
print(solve(letters, mod))


import string
MOD = 10 ** 9 + 7
digits = string.digits + string.ascii_uppercase + string.ascii_lowercase + '-_'
assert len(digits) == 64
zero_cnt = {k: '{:0>6b}'.format(i).count('0') for (i, k) in enumerate(digits)}
x = sum([zero_cnt[ch] for ch in input()])
print(3 ** x % MOD)


def sti(x):
	o = 0
	x = x[::-1]
	k = 1
	ans = 1
	for i in x:
		l = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
		o = l.index(i) * k
		for i in range(0, 6):
			if o & 2 ** i == 0:
				ans = ans * 3 % 1000000007
	return ans

def bth(x):
	x = x[::-1]
	k = 1
	o = 0
	for i in x:
		o += int(i) * k
		k *= 2
	return str(o)

def htb(x):
	x = int(x)
	s = ''
	while x > 0:
		s += str(x % 2)
		x //= 2
	return s[::-1]
s = input()
print(sti(s))