1. 

/**
* FWP: Ausgewaehlte Probleme aus dem ACM (SS10)
*
* Method: ad hoc
* Problem: 537 - Artificial Intelligence?
* Accepted: 0.108
* @author Evgeni Pavlidis
*
*/

import java.io.*;
import java.util.*;

class Main {

public static void main(String...args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String input;
int testCases = Integer.parseInt(reader.readLine());
double current;
int j;


for(int c = 1; c <= testCases; c++)
{
double P = 0.0,U = 0.0 ,I = 0.0;
input = reader.readLine();
for(int i = 0; i < input.length(); i++)
if(input.charAt(i) == '=')
{
j = i+1;
while(Character.isDigit(input.charAt(j)) || input.charAt(j) == '.' )
j++;

current = Double.parseDouble(input.substring(i+1,j));

if(input.charAt(j) == 'm')
current /= 1000;
else if(input.charAt(j) == 'k')
current *= 1000;
else if(input.charAt(j) == 'M')
current *= 1000*1000;

if(input.charAt(i-1) == 'U')
U = current;
else if(input.charAt(i-1) == 'P')
P = current;
else if(input.charAt(i-1) == 'I')
I = current;
}

if(U == 0.0)
System.out.printf("Problem #%d\nU=%.2fV\n\n", c, P/I);
else if(P == 0.0)
System.out.printf("Problem #%d\nP=%.2fW\n\n", c, U*I);
else if(I == 0.0)
System.out.printf("Problem #%d\nI=%.2fA\n\n", c, P/U);
}
}
}