#include <ctype.h>
#include <stdio.h>
#include <string.h>

#define countof(array) (sizeof(array) / sizeof((array)[0]))

// Удаляет пробелы (а главное \r\n и \n) с конца строки.
static void rstrip(char *s)
{
	for (int i = strlen(s) - 1; i >= 0; i--) {
		if (!isspace(s[i])) {
			s[i + 1] = '\0';
			break;
		}
	}
}

int main(void)
{
	char needle[64];
	fgets(needle, countof(needle), stdin);
	rstrip(needle);
	
	// Тут ты открываешь файл, из которого будешь читать, а у меня stdin вместо него.
	
	char line[1024];
	while (fgets(line, countof(line), stdin)) {
		rstrip(line);
		char *word = strtok(line, "=");
		char *translation = strtok(NULL, "");

		if (!strcmp(needle, word)) {
			printf("Found translation for %s: %s\n", needle, translation);
		}
		
		if (!strcmp(needle, translation)) {
			printf("%s is a translation of %s\n", needle, word);
		}
	}
}