import std.stdio;
import std.string;
import std.conv;

void main(){
  int n=to!int(readln().chomp);
  while(n--){
  	const int[string] MP=["yotta":24,"zetta":21,"exa":18,"peta":15,"tera":12,"giga":9,"mega":6,"kilo":3,"hecto":2,"deca":1,
  	"deci":-1,"centi":-2,"milli":-3,"micro":-6,"nano":-9,"pico":-12,"femto":-15,"ato":-18,"zepto":-21,"yocto":-24];
    auto s = readln.chomp.split;
    int a=0;
    if(s[0][0]=='0'){
    	s[0]=s[0].split(".").join;
    	for(;a<s[0].length&&s[0][a]=='0';++a){}
    	if(a==s[0].length-1) s[0]=to!string(s[0][a]);
    	else s[0]=s[0][a]~"."~s[0][a+1..s[0].length];
   		a=-a;
    }else{
    	for(;a<s[0].length&&s[0][a]!='.';++a){}
    	if(a==s[0].length){
    		s[0]=s[0][0]~"."~s[0][1..s[0].length];
    		--a;
    	}else{
    		auto t=s[0].split(".").join;
    		s[0]=t[0]~"."~t[1..t.length];
    		--a;
    	}
    }
    if(s[1] in MP) a+=MP[s[1]];
    writeln(s[0]~" * "~"10^"~to!string(a)~" "~((s.length>2)?s[2]:s[1]));
  }
}