#include<iostream>
#include<fstream>
#include<string>
#include<cmath>
#include<iomanip>
#define size 1001
using namespace std;

int main()
{
	string ion[size];
	double time[size];
	double xyz[size][3];
	double distance[size];
	double velocity[size];
	
	fstream input ("inData.txt", ios::in);
	fstream output("result.txt", ios::out);
	
	for (int i = 0; i < size; i++)
	{
		input >> ion[i];
		input >> time[i];
		
		for (int j = 0; j < 3; j++)
		{
			input >> xyz[i][j];
		}
	}
	
	for (int i = 0; i < size; i++)
	{
		distance[i]=sqrt( (pow(xyz[i+1][0] - xyz[i][0], 2.0)) + 
						  (pow(xyz[i+1][1] - xyz[i][1], 2.0)) + 
						  (pow(xyz[i+2][2] - xyz[i][2], 2.0)) );
	}
	
	for (int i = 0; i < size; i++)
	{
		velocity[i] = distance[i] / time[i];
	}
	
	output << left;
	output << setw(20) << "Position";
	output << setw(20) << "Distance";
	output << setw(20) << "Velocity" << endl;
	output << "------------------------------------------------" << endl;
	
	for (int i = 0; i < size; i++)
	{
		output << left;
		output << setw(20) << i + 1;
		output << setw(20) << distance[i];
		output << setw(20) << velocity[i];
		output << endl;
	}
	
	return 0;
}
