#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=1e9+7; ll f(ll n){ if(n==0) return 2; ll res=0; for(ll i=max(0LL,n-4);i<=n;i++){ ll c=1; for(ll j=i+1;j<=n;j++){ c*=j; c%=10; } res+=c; res%=10; } return res; } int main(){ int T; cin>>T; for(int t=0;t>N; cout<