1. 

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS2010
* Problem: Homer Simpson 10465
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1406
*
* @author Barny Porcio
* @version 1.0, 06/27/2010
*
* Status : Accepted
* Runtime: 0.884
*/
import java.io.IOException;
import java.util.Scanner;


public class Homer_Simpson_10465 {

/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
// StringTokenizer read = new StringTokenizer(br.readLine());
int m = sc.nextInt();//Integer.parseInt(read.nextToken());
int n = sc.nextInt();//Integer.parseInt(read.nextToken());
int t = sc.nextInt();//Integer.parseInt(read.nextToken());
if (n < m){
int temp = m;
m = n;
n = temp;
}
int[] ans = new int[2];
ans[1] = Integer.MAX_VALUE;
for (int i = t /m; i >=0;--i){
int rest = t-(i*m);
if (rest%n == 0 ){
ans[0] = i + rest/n;
ans[1] = 0;
break;
}
else if (rest%n < ans[1]){
ans[0] = i + rest/n;
ans[1] = rest %n;
}
}
if (ans[1] == 0)
System.out.println(ans[0]);
else{
System.out.println(ans[0]+" "+ans[1]);
}

}

}

}