import java.util.Scanner; class robotto{ public static void main(String args[]){ Scanner s = new Scanner(System.in); int x = s.nextInt(); int y = s.nextInt(); int L = s.nextInt(); int xtime = (int)Math.abs(x / L); int ytime = (int)Math.abs(y / L); int retur = 1; if(x == 0 || y == 0){ retur = 0; } if(x != 0 && (x % L != 0 || Math.abs(x) < L)){ xtime += 1; } if(y != 0 && (y % L != 0 || Math.abs(y) < L)){ ytime += 1; } System.out.println(xtime + " " + ytime + " " + retur); System.out.println(xtime + ytime + retur); } }