#include <iostream>
#include <stdio.h>
#include <math.h>
#define MAX 1010
#define PI 3.141592
using namespace std;
int main(){
  int n,i;
  //float x[MAX],y[MAX];
  double rad[MAX]={};
  for(i=2;i<MAX;i++){
    rad[i]=rad[i-1]+atan(1.0/sqrt(i-1));
    if(rad[i]>2*PI) rad[i]-=2*PI; 
    
  }
  cin >> n;
  while (n!=-1){
    printf("%.2f\n%.2f\n",sqrt(n)*cos(rad[n]),sqrt(n)*sin(rad[n]));
    cin >> n;
  }
  
  return 0;
}