#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

typedef map<string,int> msi;

/* global variables */

msi pfxmap;

/* subroutines */

/* main */

int main() {
  pfxmap["yotta"] = 24;
  pfxmap["zetta"] = 21;
  pfxmap["exa"] = 18;
  pfxmap["peta"] = 15;
  pfxmap["tera"] = 12;
  pfxmap["giga"] = 9;
  pfxmap["mega"] = 6;
  pfxmap["kilo"] = 3;
  pfxmap["hecto"] = 2;
  pfxmap["deca"] = 1;
  pfxmap["deci"] = -1;
  pfxmap["centi"] = -2;
  pfxmap["milli"] = -3;
  pfxmap["micro"] = -6;
  pfxmap["nano"] = -9;
  pfxmap["pico"] = -12;
  pfxmap["femto"] = -15;
  pfxmap["ato"] = -18;
  pfxmap["zepto"] = -21;
  pfxmap["yocto"] = -24;

  int tn;
  cin >> tn;

  while (tn--) {
    string nstr, pstr, ustr;
    cin >> nstr >> pstr;

    msi::iterator mit = pfxmap.find(pstr);
    int pexp = 0;
    
    if (mit == pfxmap.end())
      ustr = pstr;
    else {
      cin >> ustr;
      pexp = mit->second;
    }

    int prd = nstr.find('.', 0);
    int fp, np = nstr.length() - 1;
    
    if (prd == string::npos)	// no period
      prd = np;
    else {	// found period
      nstr.erase(prd, 1);
      prd--;
      np--;
    }

    for (fp = 0; fp <= np && nstr[fp] == '0'; fp++);
    if (fp > 0) {
      nstr.erase(0, fp);
      prd -= fp;
      np -= fp;
    }

    if (np > 0) nstr.insert(1, ".");

    cout << nstr << " * 10^" << (prd + pexp) << ' ' << ustr << endl;
  }

  return 0;
}