#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,m,k,x,y;
	cin>>n>>m>>k;
	x=k/n+1;
	y=k%n;
	cout<<5<<" "<<x+y-1;
	return 0;
}