#include <cstdio>
#include <iostream>
#include <chrono>
#include <cstdlib>
using namespace std;

int main(int argc,char **argv) {
	int n = atoi(argv[1]);
	char _[n+1];
	scanf("%s", _);
	std::chrono::time_point<std::chrono::system_clock> start, end;
	start = std::chrono::system_clock::now();
	scanf("%s", _);
	end = std::chrono::system_clock::now();
	std::chrono::duration<double> elapsed_seconds = end-start;
    std::time_t end_time = std::chrono::system_clock::to_time_t(end);
 
    std::cout << (double)elapsed_seconds.count() << 
"s\n" << (double)elapsed_seconds.count()/n << "s\n";
}
