import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
BigInteger a = in.nextBigInteger();
BigInteger b = in.nextBigInteger();
BigInteger c = a.divide(b);
System.out.println(c);
System.out.println(a.subtract(c.multiply(b)));
}
}