Problem:
Score : 300 points

Problem Statement

1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:

the dogs numbered 1,2,\cdots,26 were respectively given the names a, b, ..., z;

the dogs numbered 27,28,29,\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;

the dogs numbered 703,704,705,\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;

the dogs numbered 18279,18280,18281,\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;

the dogs numbered 475255,475256,\cdots were respectively given the names aaaaa, aaaab, ...;

and so on.

To sum it up, the dogs numbered 1, 2, \cdots were respectively given the following names:

a, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...

Now, Roger asks you:

"What is the name for the dog numbered N?"

Constraints

N is an integer.

1 \leq N \leq 1000000000000001

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer to Roger's question as a string consisting of lowercase English letters.

Sample Input 1

2

Sample Output 1

b

Sample Input 2

27

Sample Output 2

aa

Sample Input 3

123456789

Sample Output 3

jjddja

Solution in Rust (1.42.0) (judge verdict: Accepted)

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::char;

fn ans(n: u128) {
    if n == 1 {
        println!("a");
        return;
    }
    let mut pows: Vec<u128> = Vec::new();
    let mut pre = 1;
    pows.push(1);
    for _ in 1..15 {
        pre = pre * 26;
        pows.push(pre);
    }

    let mut ths: Vec<u128> = Vec::new();
    ths.push(0);
    for i in 1..15 {
        ths.push(ths[i - 1] + pows[i]);
    }
    for i in 1..15 {
        if ths[i - 1] < n && n <= ths[i] {
            let val = n - ths[i - 1] - 1;
            /*
            println!(
                "{} -> {} -> {}: val {}, i {}",
                ths[i - 1],
                n,
                ths[i],
                val,
                i
            );
            */
            let mut next_val = val;
            let mut s = String::from("");
            for j in (0..i).rev() {
                /*
                println!(
                    "{}: {} * {} + {} => {}",
                    next_val,
                    next_val / pows[j],
                    pows[j],
                    next_val % pows[j],
                    (((next_val / pows[j]) + 97) as u8) as char
                );
                */

                s += &format!("{}", (((next_val / pows[j]) + 97) as u8) as char);
                next_val = next_val % pows[j];
            }
            println!("{}", s);
            return;
        }
        pre = pre * 26;
    }
}

fn main() {
    input! {
        n: u128,
    };
    ans(n);
    /*
    for i in 1..1000 {
        print!("{}: ", i);
        ans(i);
    }
    */
    /*
    // 大きいものから順番に見ていく
    pows.reverse();

    let mut next_val = n;
    for pow in pows {
        // powのほうがおおきければスルー
        if next_val < pow {
            continue;
        }
        // powがいくつ入るか
        let d = next_val / pow;
        // わりきれなかった部分を残りに回す
        next_val = n % pow;
        if d > 0 {
            let d = d + 96;
            print!("{}", (d as u8) as char);
        } else {

        }
    }
    print!("\n");
    */
}