#include<bits/stdc++.h> using namespace std; int main(){ int x,k,n; cin>>n; x=100; while(1){ if(( n - x * 7 ) % 21 == 0 ){ k=(n-x*7)/21; if(k>0) break; } x--; } cout<<x<<endl; cout<<k<<endl; }