import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

// Solution
public class Main {
  private static Scanner in;
  private static PrintWriter out;
  private static final String INPUT = ""; // input file name

  /**
   * Interactive get next command
   */
  static int get(int pos) {
    out.println(pos + 1);
    out.flush();
    return ni();
  }

  static void solve() {
    int a = ni();

    out.println(a + a * a + a * a * a);
  }

  static String convert(int x) {
    char[] z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

    StringBuilder sb = new StringBuilder();

    while (x > 0) {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    }

    return sb.reverse().toString();
  }

  static int sconvert(String s) {
    int ans = 0;

    for (char c: s.toCharArray()) {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    }

    return ans;
  }

  public static void main(String[] args) throws Exception {
    long S = System.currentTimeMillis();
    in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
    out = new PrintWriter(System.out);

    solve();
    out.flush();
    long G = System.currentTimeMillis();
    tr(G - S + "ms");
  }

  private static int gcd(int a, int b) {
    while (b != 0) {
      int t = b;
      b = a % b;
      a = t;
    }

    return a;
  }

  private static int ni() {
    return in.nextInt();
  }

  private static String nt() {
    return in.next();
  }

  private static String ns() {
    return in.nextLine();
  }

  private static long nl() {
    return in.nextLong();
  }

  // Math Utils
  private static int pi(int num, int pow) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static int pim(int num, int pow, int mod) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  private static long pl(long num, long pow) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static long plm(long num, long pow, long mod) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  static void tr(Object... o) {
    if (!INPUT.isEmpty())
      out.println(Arrays.deepToString(o));
  }

  private static void fo(int begin, int end, Callback call) {
    for (int i = begin; i < end; i++) {
      call.call(i);
    }
  }

  @FunctionalInterface
  private interface Callback {
    void call(int index);
  }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
  private static Scanner in;
  private static PrintWriter out;
  private static final String INPUT = ""; // input file name

  /**
   * Interactive get next command
   */
  static int get(int pos) {
    out.println(pos + 1);
    out.flush();
    return ni();
  }

  static void solve() {
    int a = ni();

    out.println(a + a * a + a * a * a);
  }

  static String convert(int x) {
    char[] z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

    StringBuilder sb = new StringBuilder();

    while (x > 0) {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    }

    return sb.reverse().toString();
  }

  static int sconvert(String s) {
    int ans = 0;

    for (char c: s.toCharArray()) {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    }

    return ans;
  }

  public static void main(String[] args) throws Exception {
    long S = System.currentTimeMillis();
    in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
    out = new PrintWriter(System.out);

    solve();
    out.flush();
    long G = System.currentTimeMillis();
    tr(G - S + "ms");
  }

  private static int gcd(int a, int b) {
    while (b != 0) {
      int t = b;
      b = a % b;
      a = t;
    }

    return a;
  }

  private static int ni() {
    return in.nextInt();
  }

  private static String nt() {
    return in.next();
  }

  private static String ns() {
    return in.nextLine();
  }

  private static long nl() {
    return in.nextLong();
  }

  // Math Utils
  private static int pi(int num, int pow) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static int pim(int num, int pow, int mod) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  private static long pl(long num, long pow) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static long plm(long num, long pow, long mod) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  static void tr(Object... o) {
    if (!INPUT.isEmpty())
      out.println(Arrays.deepToString(o));
  }

  private static void fo(int begin, int end, Callback call) {
    for (int i = begin; i < end; i++) {
      call.call(i);
    }
  }

  @FunctionalInterface
  private interface Callback {
    void call(int index);
  }
} Main private static Scanner in; in private static PrintWriter out; out private static final String INPUT = ""; // input file name INPUT "" /**
   * Interactive get next command
   */
  static int get(int pos) {
    out.println(pos + 1);
    out.flush();
    return ni();
  } get {
    out.println(pos + 1);
    out.flush();
    return ni();
  } out.println(pos + 1) out.println out pos + 1 pos 1 out.flush() out.flush out return ni(); ni() ni int pos pos static void solve() {
    int a = ni();

    out.println(a + a * a + a * a * a);
  } solve {
    int a = ni();

    out.println(a + a * a + a * a * a);
  } int a = ni(); a ni() ni out.println(a + a * a + a * a * a) out.println out a + a * a + a * a * a a + a * a + a * a * a a a * a a a a * a * a a * a * a a a a static String convert(int x) {
    char[] z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

    StringBuilder sb = new StringBuilder();

    while (x > 0) {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    }

    return sb.reverse().toString();
  } convert {
    char[] z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

    StringBuilder sb = new StringBuilder();

    while (x > 0) {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    }

    return sb.reverse().toString();
  } char[] z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); z "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray() "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray "ABCDEFGHIJKLMNOPQRSTUVWXYZ" StringBuilder sb = new StringBuilder(); sb new StringBuilder() while (x > 0) {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    } x > 0 x 0 {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    } if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      } x % 26 == 0 x % 26 x 26 0 {
        x = x / 26 - 1;
        sb.append('Z');
      } x = x / 26 - 1 x x / 26 - 1 x / 26 x 26 1 sb.append('Z') sb.append sb 'Z' {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      } sb.append(z[x % 26 - 1]) sb.append sb z[x % 26 - 1] z x % 26 - 1 x % 26 x 26 1 x = x / 26 x x / 26 x 26 return sb.reverse().toString(); sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb int x x static int sconvert(String s) {
    int ans = 0;

    for (char c: s.toCharArray()) {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    }

    return ans;
  } sconvert {
    int ans = 0;

    for (char c: s.toCharArray()) {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    }

    return ans;
  } int ans = 0; ans 0 for (char c: s.toCharArray()) {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    } char c s.toCharArray() s.toCharArray s {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    } {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    } int t = c - 'A' + 1; t c - 'A' + 1 c - 'A' c 'A' 1 ans = ans * 26 + t ans ans * 26 + t ans * 26 ans 26 t return ans; ans String s s public static void main(String[] args) throws Exception {
    long S = System.currentTimeMillis();
    in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
    out = new PrintWriter(System.out);

    solve();
    out.flush();
    long G = System.currentTimeMillis();
    tr(G - S + "ms");
  } main {
    long S = System.currentTimeMillis();
    in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
    out = new PrintWriter(System.out);

    solve();
    out.flush();
    long G = System.currentTimeMillis();
    tr(G - S + "ms");
  } long S = System.currentTimeMillis(); S System.currentTimeMillis() System.currentTimeMillis System in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT) in INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT) INPUT.isEmpty() INPUT.isEmpty INPUT new Scanner(System.in) new Scanner(INPUT) out = new PrintWriter(System.out) out new PrintWriter(System.out) solve() solve out.flush() out.flush out long G = System.currentTimeMillis(); G System.currentTimeMillis() System.currentTimeMillis System tr(G - S + "ms") tr G - S + "ms" G - S G S "ms" String[] args args private static int gcd(int a, int b) {
    while (b != 0) {
      int t = b;
      b = a % b;
      a = t;
    }

    return a;
  } gcd {
    while (b != 0) {
      int t = b;
      b = a % b;
      a = t;
    }

    return a;
  } while (b != 0) {
      int t = b;
      b = a % b;
      a = t;
    } b != 0 b 0 {
      int t = b;
      b = a % b;
      a = t;
    } int t = b; t b b = a % b b a % b a b a = t a t return a; a int a a int b b private static int ni() {
    return in.nextInt();
  } ni {
    return in.nextInt();
  } return in.nextInt(); in.nextInt() in.nextInt in private static String nt() {
    return in.next();
  } nt {
    return in.next();
  } return in.next(); in.next() in.next in private static String ns() {
    return in.nextLine();
  } ns {
    return in.nextLine();
  } return in.nextLine(); in.nextLine() in.nextLine in private static long nl() {
    return in.nextLong();
  } nl {
    return in.nextLong();
  } return in.nextLong(); in.nextLong() in.nextLong in // Math Utils
  private static int pi(int num, int pow) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  } pi {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  } int result = 1; result 1 while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    } pow > 0 pow 0 {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    } if (pow % 2 == 1) {
        result *= num;
      } pow % 2 == 1 pow % 2 pow 2 1 {
        result *= num;
      } result *= num result num num *= num num num pow /= 2 pow 2 return result; result int num num int pow pow private static int pim(int num, int pow, int mod) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  } pim {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  } int result = 1; result 1 while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    } pow > 0 pow 0 {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    } if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      } pow % 2 == 1 pow % 2 pow 2 1 {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      } result = (result * num) % mod result (result * num) % mod (result * num) result num mod num = (num * num) % mod num (num * num) % mod (num * num) num num mod pow /= 2 pow 2 return result; result int num num int pow pow int mod mod private static long pl(long num, long pow) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  } pl {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  } long result = 1; result 1 while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    } pow > 0 pow 0 {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    } if (pow % 2 == 1) {
        result *= num;
      } pow % 2 == 1 pow % 2 pow 2 1 {
        result *= num;
      } result *= num result num num *= num num num pow /= 2 pow 2 return result; result long num num long pow pow private static long plm(long num, long pow, long mod) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  } plm {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  } long result = 1; result 1 while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    } pow > 0 pow 0 {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    } if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      } pow % 2 == 1 pow % 2 pow 2 1 {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      } result = (result * num) % mod result (result * num) % mod (result * num) result num mod num = (num * num) % mod num (num * num) % mod (num * num) num num mod pow /= 2 pow 2 return result; result long num num long pow pow long mod mod static void tr(Object... o) {
    if (!INPUT.isEmpty())
      out.println(Arrays.deepToString(o));
  } tr {
    if (!INPUT.isEmpty())
      out.println(Arrays.deepToString(o));
  } if (!INPUT.isEmpty())
      out.println(Arrays.deepToString(o)); !INPUT.isEmpty() INPUT.isEmpty() INPUT.isEmpty INPUT out.println(Arrays.deepToString(o)) out.println out Arrays.deepToString(o) Arrays.deepToString Arrays o Object... o o private static void fo(int begin, int end, Callback call) {
    for (int i = begin; i < end; i++) {
      call.call(i);
    }
  } fo {
    for (int i = begin; i < end; i++) {
      call.call(i);
    }
  } for (int i = begin; i < end; i++) {
      call.call(i);
    } int i = begin; int i = begin; i begin i < end i end i++ i++ i {
      call.call(i);
    } {
      call.call(i);
    } call.call(i) call.call call i int begin begin int end end Callback call call private interface Callback {
    void call(int index);
  } Callback void call(int index); call int index index public class Main {
  private static Scanner in;
  private static PrintWriter out;
  private static final String INPUT = ""; // input file name

  /**
   * Interactive get next command
   */
  static int get(int pos) {
    out.println(pos + 1);
    out.flush();
    return ni();
  }

  static void solve() {
    int a = ni();

    out.println(a + a * a + a * a * a);
  }

  static String convert(int x) {
    char[] z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

    StringBuilder sb = new StringBuilder();

    while (x > 0) {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    }

    return sb.reverse().toString();
  }

  static int sconvert(String s) {
    int ans = 0;

    for (char c: s.toCharArray()) {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    }

    return ans;
  }

  public static void main(String[] args) throws Exception {
    long S = System.currentTimeMillis();
    in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
    out = new PrintWriter(System.out);

    solve();
    out.flush();
    long G = System.currentTimeMillis();
    tr(G - S + "ms");
  }

  private static int gcd(int a, int b) {
    while (b != 0) {
      int t = b;
      b = a % b;
      a = t;
    }

    return a;
  }

  private static int ni() {
    return in.nextInt();
  }

  private static String nt() {
    return in.next();
  }

  private static String ns() {
    return in.nextLine();
  }

  private static long nl() {
    return in.nextLong();
  }

  // Math Utils
  private static int pi(int num, int pow) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static int pim(int num, int pow, int mod) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  private static long pl(long num, long pow) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static long plm(long num, long pow, long mod) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  static void tr(Object... o) {
    if (!INPUT.isEmpty())
      out.println(Arrays.deepToString(o));
  }

  private static void fo(int begin, int end, Callback call) {
    for (int i = begin; i < end; i++) {
      call.call(i);
    }
  }

  @FunctionalInterface
  private interface Callback {
    void call(int index);
  }
} public class Main {
  private static Scanner in;
  private static PrintWriter out;
  private static final String INPUT = ""; // input file name

  /**
   * Interactive get next command
   */
  static int get(int pos) {
    out.println(pos + 1);
    out.flush();
    return ni();
  }

  static void solve() {
    int a = ni();

    out.println(a + a * a + a * a * a);
  }

  static String convert(int x) {
    char[] z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

    StringBuilder sb = new StringBuilder();

    while (x > 0) {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    }

    return sb.reverse().toString();
  }

  static int sconvert(String s) {
    int ans = 0;

    for (char c: s.toCharArray()) {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    }

    return ans;
  }

  public static void main(String[] args) throws Exception {
    long S = System.currentTimeMillis();
    in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
    out = new PrintWriter(System.out);

    solve();
    out.flush();
    long G = System.currentTimeMillis();
    tr(G - S + "ms");
  }

  private static int gcd(int a, int b) {
    while (b != 0) {
      int t = b;
      b = a % b;
      a = t;
    }

    return a;
  }

  private static int ni() {
    return in.nextInt();
  }

  private static String nt() {
    return in.next();
  }

  private static String ns() {
    return in.nextLine();
  }

  private static long nl() {
    return in.nextLong();
  }

  // Math Utils
  private static int pi(int num, int pow) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static int pim(int num, int pow, int mod) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  private static long pl(long num, long pow) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static long plm(long num, long pow, long mod) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  static void tr(Object... o) {
    if (!INPUT.isEmpty())
      out.println(Arrays.deepToString(o));
  }

  private static void fo(int begin, int end, Callback call) {
    for (int i = begin; i < end; i++) {
      call.call(i);
    }
  }

  @FunctionalInterface
  private interface Callback {
    void call(int index);
  }
} Main
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

// Solution
public class Main {
  private static Scanner in;
  private static PrintWriter out;
  private static final String INPUT = ""; // input file name

  /**
   * Interactive get next command
   */
  static int get(int pos) {
    out.println(pos + 1);
    out.flush();
    return ni();
  }

  static void solve() {
    int a = ni();

    out.println(a + a * a + a * a * a);
  }

  static String convert(int x) {
    char[] z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

    StringBuilder sb = new StringBuilder();

    while (x > 0) {
      if (x % 26 == 0) {
        x = x / 26 - 1;
        sb.append('Z');
      } else {
        sb.append(z[x % 26 - 1]);
        x = x / 26;
      }
    }

    return sb.reverse().toString();
  }

  static int sconvert(String s) {
    int ans = 0;

    for (char c: s.toCharArray()) {
      int t = c - 'A' + 1;
      ans = ans * 26 + t;
    }

    return ans;
  }

  public static void main(String[] args) throws Exception {
    long S = System.currentTimeMillis();
    in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
    out = new PrintWriter(System.out);

    solve();
    out.flush();
    long G = System.currentTimeMillis();
    tr(G - S + "ms");
  }

  private static int gcd(int a, int b) {
    while (b != 0) {
      int t = b;
      b = a % b;
      a = t;
    }

    return a;
  }

  private static int ni() {
    return in.nextInt();
  }

  private static String nt() {
    return in.next();
  }

  private static String ns() {
    return in.nextLine();
  }

  private static long nl() {
    return in.nextLong();
  }

  // Math Utils
  private static int pi(int num, int pow) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static int pim(int num, int pow, int mod) {
    int result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  private static long pl(long num, long pow) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        result *= num;
      }

      num *= num;
      pow /= 2;
    }

    return result;
  }

  private static long plm(long num, long pow, long mod) {
    long result = 1;

    while (pow > 0) {
      if (pow % 2 == 1) {
        // keep collecting `odd` num in result
        result = (result * num) % mod;
      }

      num = (num * num) % mod;
      pow /= 2;
    }

    return result;
  }

  static void tr(Object... o) {
    if (!INPUT.isEmpty())
      out.println(Arrays.deepToString(o));
  }

  private static void fo(int begin, int end, Callback call) {
    for (int i = begin; i < end; i++) {
      call.call(i);
    }
  }

  @FunctionalInterface
  private interface Callback {
    void call(int index);
  }
}
