Problem list
Log in
#r03345 · Online Judge > GoldOJ

Find 'g' or -1

Bronze III 2.0 s 256 MB

Given a lowercase word, print all $0$-based indices where g appears, in ascending order, space-separated. If there is no g, print -1.

Input

One lowercase word of length $1$ to $100$.

Output

Print the indices of g, or -1 if none.

Example 1

Input
algorithm
Output
2

Example 2

Input
google
Output
0 3

Example 3

Input
apple
Output
-1
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code