#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;

int main() {
	int N;cin>>N;
	int num=N*2;
	int h=num/60;
	int m=num%60;
	cout<<h<<" "<<m<<endl;
	return 0;
}