// Arup Guha
// 11/6/2020
// Grading Program for CIS 3362 Homework 6, Problem #7

import java.math.*;
import java.util.*;

public class gradep7 {

	// Public keys.
	final public static BigInteger n = new BigInteger("5959543795627426174320202010482251983");
	final public static BigInteger d = new BigInteger("3559217891888419062566936314863048839");

	// For Radix 64.
	final public static BigInteger BASE = new BigInteger("64");

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		
		// Process each line...just call modPow!
		while (stdin.hasNext()) {
			BigInteger cipher = new BigInteger(stdin.nextLine());
			BigInteger plain = cipher.modPow(d, n);
			System.out.println(numToString(plain, 20));
		}
	}
	
	// Returns the character corresponding to the Radix-64 value val.
	public static char convert(int val) {
	
		// Upper case letters.
		if (val < 26) return (char)('A'+val);
			
		// Lower case letters.
		if (val < 52) return (char)('a'+val-26);
			
		// Digits.
		if (val < 62) return (char)('0'+val-52);
			
		// Special characters.
		if (val == 62) return '+';
		return '/';
	}
	
	// Convert this BigInteger to a Radix-64 string of numC characters.
	public static String numToString(BigInteger val, int numC) {
		char[] res = new char[numC];
		for (int i=numC-1; i>=0; i--) {
			int thisVal = val.mod(BASE).intValue();
			res[i] = convert(thisVal);
			val = val.divide(BASE);
		}
		return new String(res);
	}

}