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

int main(void)
{
    double value;
    char from[30];
    char to[30];
    double result;

    printf("Enter value: ");
    scanf("%lf", &value);

    printf("Enter source unit: ");
    scanf("%29s", from);

    printf("Enter target unit: ");
    scanf("%29s", to);

    if (strcmp(from, "meters") == 0 &&
        strcmp(to, "feet") == 0)
    {
        result = value * 3.28084;
    }
    else if (strcmp(from, "feet") == 0 &&
             strcmp(to, "meters") == 0)
    {
        result = value / 3.28084;
    }
    else if (strcmp(from, "kilograms") == 0 &&
             strcmp(to, "pounds") == 0)
    {
        result = value * 2.20462;
    }
    else if (strcmp(from, "pounds") == 0 &&
             strcmp(to, "kilograms") == 0)
    {
        result = value / 2.20462;
    }
    else if (strcmp(from, "liters") == 0 &&
             strcmp(to, "gallons") == 0)
    {
        result = value * 0.264172;
    }
    else if (strcmp(from, "gallons") == 0 &&
             strcmp(to, "liters") == 0)
    {
        result = value / 0.264172;
    }
    else
    {
        printf("Invalid conversion.\n");
        return 0;
    }

    printf("%.2f %s = %.2f %s\n",
           value, from, result, to);

    return 0;
}