#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <queue>
#include <ctime>
using namespace std;
template <class T> void checkmin(T &t,T x){if (x < t) t = x;}
template <class T> void checkmax(T &t,T x){if (x > t) t = x;}
template <class T> void _checkmin(T &t, T x){if (t == -1) t = x; if (x < t) t = x;}
template <class T> void _checkmax(T &t, T x){if (t == -1) t = x; if (x > t) t = x;}
typedef pair <int,int> PII;
typedef pair <double,double> PDD;
typedef long long lld;
#define foreach(it,v) for (__typeof((v).begin()) it = (v).begin();it != (v).end();it++)
#define DEBUG(a) cout << #a" = " << (a) << endl;
#define DEBUGARR(a, n) for (int i = 0; i < (n); i++) { cout << #a"[" << i << "] = " << (a)[i] << endl; }
char str[1000];
int main(){
#ifdef cwj
	freopen("in", "r", stdin);
#endif
	int tt;
	int a,b,c,s,i,j;
	scanf("%d",&tt);
	
	while(tt--){
		char ch= getchar();
		while(ch!='\'') ch = getchar();//,printf("*%c*\n",ch);
		int t = 0;
		str[t] = getchar();
		while(str[t]!='\'') {
			//printf("%c\n",str[t]);
			t++;
			str[t] = getchar();
		}
		str[t] = 0;
		scanf("%d%d%d%d",&a,&b,&c,&s);
		long long ans  = (a*b+b*c+a*c)*2+6*b+3*c;
		int ret[100],a = 0;
		while(ans){
			ret[a++] = ans%10;
			ans/=10;
		}
		printf("\"The Present %s requires ",str);

		for (i=a-1,j=s;j>0;j--,i--)
			printf("%d",ret[i]);
		for (;i>=0;i--)
			printf("0");
		printf(" square frightometers of paper to wrap\"\n");
	}
}
