#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

// TODO: Implement normal_cdf(double x)
// Compute the cumulative standard normal distribution function N(x)
// Use the erf function from <cmath>
// Formula: N(x) = 0.5 * (1 + erf(x / sqrt(2)))
double normal_cdf(double x) {
    (void)x;  // Suppress unused parameter warning
    // Implement this
    return 0.0;  // Placeholder
}

// TODO: Implement normal_pdf(double x)
// Compute the standard normal probability density function n(x)
// Formula: n(x) = exp(-x^2/2) / sqrt(2*pi)
double normal_pdf(double x) {
    (void)x;  // Suppress unused parameter warning
    // Implement this
    return 0.0;  // Placeholder
}

// TODO: Implement compute_option()
// Given parameters S, K, T, r, sigma, type, compute:
// - Option price (call or put)
// - Delta (rate of change with underlying)
// - Gamma (rate of change of delta)
// - Vega (rate of change with volatility, per 1.0 change)
// - Theta (time decay, per year)
// - Rho (rate of change with interest rate)
//
// Black-Scholes formulas:
// d1 = (ln(S/K) + (r + sigma^2/2) * T) / (sigma * sqrt(T))
// d2 = d1 - sigma * sqrt(T)
//
// Call Price = S * N(d1) - K * e^(-rT) * N(d2)
// Put Price  = K * e^(-rT) * N(-d2) - S * N(-d1)
//
// Delta_Call = N(d1),           Delta_Put = N(d1) - 1
// Gamma = n(d1) / (S * sigma * sqrt(T))
// Vega = S * n(d1) * sqrt(T)
// Theta_Call = -(S * n(d1) * sigma) / (2 * sqrt(T)) - r * K * e^(-rT) * N(d2)
// Theta_Put  = -(S * n(d1) * sigma) / (2 * sqrt(T)) + r * K * e^(-rT) * N(-d2)
// Rho_Call = K * T * e^(-rT) * N(d2)
// Rho_Put  = -K * T * e^(-rT) * N(-d2)
//
void compute_option(double S, double K, double T, double r, double sigma,
                    char type, double& price, double& delta, double& gamma,
                    double& vega, double& theta, double& rho) {
    (void)S;      // Suppress unused parameter warnings
    (void)K;
    (void)T;
    (void)r;
    (void)sigma;
    (void)type;

    // Implement Black-Scholes calculation here
    // Compute d1, d2
    // Get N(d1), N(d2), N(-d1), N(-d2) using normal_cdf()
    // Get n(d1) using normal_pdf()
    // Compute discount factor: e^(-rT)
    // Calculate all Greeks based on option type

    price = 0.0;   // TODO
    delta = 0.0;   // TODO
    gamma = 0.0;   // TODO
    vega = 0.0;    // TODO
    theta = 0.0;   // TODO
    rho = 0.0;     // TODO
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N;
    cin >> N;

    // Set output precision
    cout << fixed << setprecision(6);

    for (int i = 0; i < N; i++) {
        double S, K, T, r, sigma;
        char type;
        char comma;

        // Parse CSV input: S,K,T,r,sigma,type
        cin >> S >> comma >> K >> comma >> T >> comma >> r >> comma >> sigma >> comma >> type;

        double price, delta, gamma, vega, theta, rho;
        compute_option(S, K, T, r, sigma, type, price, delta, gamma, vega, theta, rho);

        cout << price << " " << delta << " " << gamma << " " << vega << " " << theta << " " << rho << "\n";
    }

    return 0;
}
