Amplitude Hackathon '23 Practice Problem 2 - Go Amplitude!

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

At the end of the last All Hands, Spenser says GO AMPLITUDE very emphatically. The Zoom caption transcription bugs out and starts emitting GOAMPLITUDE in an infinite loop.

You are curious what the Nth letter of a string of GOAMPLITUDE repeating infinitely looks like.

Constraints

1 \le N < 10^{1000000}

Subtask 1 [1 point]

N \le 11

Subtask 2 [1 point]

N \le 10^3

Subtask 3 [1 point]

N \le 10^6

Subtask 4 [1 point]

N \le 10^{18}

Subtask 5 [1 point]

No additional constraints.

Input Specification

The first and only line of input contains a single positive integer N.

Output Specification

Output the Nth letter of a string of GOAMPLITUDE repeating infinitely.

Sample Input 1

11

Sample Output 1

E

Sample Explanation 1

The first 11 letters are GOAMPLITUDE, so the 11th letter is an E.

Sample Input 2

12

Sample Output 2

G

Sample Explanation 2

The first 22 letters are GOAMPLITUDEGOAMPLITUDE. The 12th letter is therefore a G.


Comments

There are no comments at the moment.