#include using namespace std; int main(){ int n,ans; cin>>n; vector a={2,8,5,7,1,4}; ans=a[(n-1)%6]; cout<