# AGE
---
## 🧠 HOW TO SOLVE THIS PROBLEM?
When comparing two people to see who is older, we must consider the following cases:
- Compare year -> smaller year -> older.
- If years are the same, compare month -> smaller month -> older.
- If months are the same, compare day -> smaller day -> older.
---
## 📜 FULL CODE
### 🔹C++
```cpp
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int a, b, c, x, y, z;
cin >> a >> b >> c >> x >> y >> z;
if (c != z) {
if (c < z) cout << 1;
else cout << 2;
} else {
if (b != y) {
if (b < y) cout << 1;
else cout << 2;
} else {
if (a < x) cout << 1;
else cout << 2;
}
}
return 0;
}
```
### 🔹Python
```python
a, b, c, x, y, z = map(int, input().split())
print(1 if (c, b, a) < (z, y, x) else 2)
```
---
## HAPPY CODING!