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