#include using namespace std; signed main() { int n = 114514; cin >> n; if (n == 1) { cout << 7 << endl; } else if (n == 2) { cout << 8 << endl; } else if (n == 3) { cout << 9 << endl; } else if (n == 10) { cout << 0 << endl; } else if (n == 5) { cout << 5 << endl; } else if (n == 6) { cout << 6 << endl; } else if (n == 4) { cout << 4 << endl; } else if (n == 8) { cout << 2 << endl; } else if (n == 9) { cout << 3 << endl; } else { cout << 1 << endl; } return 0; }