Task:
Karol and Tomek are playing a game where they hide a word in a 10x10 grid. The word is hidden by placing the first letter in a random cell, then the next letter in an adjacent cell (up, down, left, or right). Each letter must be placed in a unique cell, and the rest of the grid is filled with random letters.
Tomek's job is to find the hidden word in the grid. The grid is represented as a string of 100 letters (10 rows, 10 columns). Your task is to write a program that reads the grid and the hidden word, and finds the position of the first letter of the word in the grid. If the word appears multiple times, return the smallest position. If the word is not found, return -1.
Input:
- A string of 100 uppercase letters representing the 10x10 grid (first 10 letters = row 1, next 10 = row 2, etc.).
- A string representing the hidden word (1 to 100 characters long).
Output:
The position of the first letter of the word in the grid (1 to 100), or -1 if the word is not found.