#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
#define INF 1e20
string str;
double p, u, i;
double change(int x)
{
double res = 0;
int u = -1, end = -1;
char ch;
const double m = 0.001, k = 1000.0, M = 1000000.0;
for (int i = x; i < str.length(); i++)
{
if (str[i] != '.' && (str[i] < '0' || str[i] > '9'))
{
end = i;
ch = str[i];
break;
}
if (str[i] == '.')
{
u = i;
}
}
if (u == -1)
{
for (int i = x; i < end; i++)
{
res = res * 10.0 + (str[i] - '0');
}
}
else
{
for (int i = x; i < u; i++)
{
res = res * 10.0 + (str[i] - '0');
}
double sum = 0;
for (int i = end - 1; i > u; i--)
{
sum = sum * 0.1 + (str[i] - '0');
}
res += sum / 10.0;
}
if (ch == 'm')
{
res *= m;
}
else if (ch == 'k')
{
res *= k;
}
else if (ch == 'M')
{
res *= M;
}
return res;
}
void find_and_change(string &str)
{
p = u = i = INF;
for (int j = 0; j < str.length(); j++)
{
if (str[j] == '=')
{
if (str[j - 1] == 'P')
{
p = change(j + 1);
}
else if (str[j - 1] == 'U')
{
u = change(j + 1);
}
else if (str[j - 1] == 'I')
{
i = change(j + 1);
}
}
}
}
void solve()
{
if (p == INF)
{
printf("P=%.2lfW\n", u * i);
}
else if (u == INF)
{
printf("U=%.2lfV\n", p / i);
}
else if (i == INF)
{
printf("I=%.2lfA\n", p / u);
}
}
void input()
{
int t, k = 0;
char ch;
scanf("%d", &t);
getchar();
while (t--)
{
getline(cin, str);
find_and_change(str);
cout << "Problem #" << ++k << endl;
solve();
cout << endl;
}
}
int main()
{
input();
return 0;
}