#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int cnt = 0; int nmax = n; while(true){ if(n == 1){ cout << cnt << endl; cout << nmax << endl; return 0; } if(n % 2 == 0){ n /= 2; }else{ n = 3 * n + 1; nmax = max(nmax, n); } cnt++; } }