#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
  int n;
  while(cin>>n){
    if(n==-1)break;
    double t=0;
    for(int i=1;i<n;i++){
      t+=atan(1/sqrt(i));
    }
    cout<<sqrt(n)*cos(t)<<endl<<sqrt(n)*sin(t)<<endl;
  }
  return 0;
}