import java.util.;
public class Main {
public static void main(String args[]) {
// Your Code Here
Scanner input = new Scanner(System.in);
int n1 = input.nextInt();
int n2 = input.nextInt();
int n3 = input.nextInt();
for(int i = n1 ; i<=n2 ; i=i+n3)
{
int c = (5/9)(i-32);
System.out.println(i + " " + c);
}
}
}