Recursion dictionary order....why it is coming rumtime error

#include <bits/stdc++.h>
using namespace std;
void phoneKeypad(string s,string input)
{ if(input.compare(s)==0)
{return;
}
cout<<input<<endl;
next_permutation(input.begin(),input.end());
return phoneKeypad(s,input);

}
int main()
{
string input;
cin >> input;
string s=input;

sort(s.begin(),s.end());
next_permutation(input.begin(),input.end());
phoneKeypad(s,input);
return 0;
}

Hey @imambujsingh08
i saw that one of ur submission has got 100 marks
do u still have any doubt?