#K85537. Flower Finder in the Garden

    ID: 36663 Type: Default 1000ms 256MiB

Flower Finder in the Garden

Flower Finder in the Garden

Your task is to implement a program that locates the positions of a specified flower in a garden. You are given a single uppercase letter representing the flower species, and a list of uppercase letters representing the garden. The goal is to output all the zero-indexed positions at which the given species is found.

Consider the garden as a sequence (G = [g_0, g_1, \dots, g_{n-1}]). You must output all indices (i) (where (0 \le i < n)) such that (g_i = s), where (s) is the specified flower species.

If the species does not occur in the garden, output an empty line.

inputFormat

The input is provided via standard input (stdin) and consists of two lines:

  1. The first line contains a single uppercase letter representing the flower species you need to find.
  2. The second line contains a space-separated list of uppercase letters representing the garden.

outputFormat

Print the zero-indexed positions of the flower species found within the garden to standard output (stdout), with each index separated by a single space. If the species is not found, output an empty line.## sample

A
B A C A D
1 3