#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>

int main(){
    std::vector<size_t> index;

    while(true){
        int32_t tmp;
        std::cin >> tmp;
        
        if(tmp == -1){
            break;
        }else{
            index.emplace_back(tmp);
        }
    }

    auto max = *std::max_element(index.begin(), index.end());
    std::vector<std::pair<double, double>> vertex = {{0.0, 1.0}, {1.0, 1.0}};

    for(size_t i = 2; i < max; i++){
        // auto [x, y] = vertex.at(i - 1);
        double x = vertex.at(i - 1).first;
        double y = vertex.at(i - 1).second;
        auto norm = std::sqrt(x * x + y * y);
        x /= norm;
        y /= norm;
        auto x2 = x * std::cos(M_PI_2) - y * std::sin(M_PI_2);
        auto y2 = x * std::sin(M_PI_2) + y * std::cos(M_PI_2);
        vertex.emplace_back(vertex.at(i - 1).first + x2, vertex.at(i - 1).second + y2);
    }

    for(const auto& e : index){
        std::cout << vertex.at(e - 1).first << std::endl << vertex.at(e - 1).second << std::endl;
    }

    return 0;
}

