#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
using namespace std;
#define m 0.001
#define k 1000.0
#define M 1000000.0
double P, U, I;
int main()
{
int n;
char s;
char ss;
char pu[5];
double x;
bool a,b,c;
scanf("%d",&n);
getchar();
for( int cnt = 1; cnt <= n; cnt++)
{
a = b= c = 0;
while(1)
{
s = getchar();
if(s == '\n')
{
printf("Problem #%d\n",cnt);
if(a == 0)
printf("I=%.2lfA\n",P/U);
else if( b == 0)
printf("U=%.2lfV\n",P/I);
else
printf("P=%.2lfW\n",I*U);
printf("\n");
break;
}
if(s == '=')
{
scanf("%lf",&x);
scanf("%s",pu);
int len = 0;
while( pu[len] != '\0')
{
if(pu[len] =='m')
x*= m;
else if(pu[len] == 'M')
x*= M;
else if(pu[len] == 'k')
x*= k;
else if(pu[len] == 'W')
{
P = x;
c = 1;
break;
}
else if(pu[len] == 'V')
{
U = x;
b = 1;
break;
}
else if(pu[len] == 'A')
{
I = x;
a = 1;
break;
}
len++;
}
}
}
}
return 0;
}
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
using namespace std;
#define m 0.001
#define k 1000.0
#define M 1000000.0
double P, U, I;
int main()
{
int n;
char s;
char ss;
char pu[5];
double x;
bool a,b,c;
scanf("%d",&n);
getchar();
for( int cnt = 1; cnt <= n; cnt++)
{
a = b= c = 0;
while(1)
{
s = getchar();
if(s == '\n')
{
printf("Problem #%d\n",cnt);
if(a == 0)
printf("I=%.2lfA\n",P/U);
else if( b == 0)
printf("U=%.2lfV\n",P/I);
else
printf("P=%.2lfW\n",I*U);
printf("\n");
break;
}
if(s == '=')
{
scanf("%lf",&x);
scanf("%s",pu);
int len = 0;
while( pu[len] != '\0')
{
if(pu[len] =='m')
x*= m;
else if(pu[len] == 'M')
x*= M;
else if(pu[len] == 'k')
x*= k;
else if(pu[len] == 'W')
{
P = x;
c = 1;
break;
}
else if(pu[len] == 'V')
{
U = x;
b = 1;
break;
}
else if(pu[len] == 'A')
{
I = x;
a = 1;
break;
}
len++;
}
}
}
}
return 0;
}