#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you int seve[] = { 2,8,5,7,1,4 }; int main() { long long n; cin >> n; cout << seve[n % 6 - 1] << endl; }