#include using namespace std; int main() { int x[] = { 7, 8, 9, 0, 5, 6, 4, 2, 3, 1 }; int n; cin >> n; cout << x[n - 1] << endl; return 0; }