#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 50

// Protótipo da função
char *string_substring(char str[], int start, int end);

int main(int argc, char **argv)
{
    char linha[100000];

    while (1)
    {
        //fgets(linha, 100000, stdin);
        scanf("%s", linha);
        //linha[strlen(linha) - 1] = '\0';

        if (strcmp(linha, "0") == 0)
        {
            break;
        }
        int num = atoi(linha);
        int bin[MAX];
        char vet_bin[MAX];
        int pal = 1;
        int j, tam = 0;
        int aux_num = num;

        while (num > 0)
        {
            bin[tam] = num % 2;
            tam++;
            num = num / 2;
        }
        for (j = tam - 1; j >= 0; j--)
        {
            vet_bin[j] = (char)(bin[j] + '0');
        }
        for (int x = 0; x < tam; x++)
        {
            if (!atoi(string_substring(vet_bin, x, x + 1)) == atoi(string_substring(vet_bin, tam - x - 1, tam - x)))
            {
                pal = 0;
                break;
            }
        }
        if (pal)
        {
            printf("V\n");
        }
        else
        {
            printf("F\n");
        }
    }
    return 0;
}

char *string_substring(char str[], int start, int end)
{
    int i, j;
    char *sub;

    if (start >= end || end > strlen(str))
    {
        return NULL;
    }

    sub = (char *)malloc(sizeof(char) * (end - start + 1));

    for (i = start, j = 0; i < end; i++, j++)
    {
        sub[j] = str[i];
    }

    sub[j] = '\0';

    return sub;
}
