#include<iostream>
using namespace std;
int main() {
    int creditScore, income;
    cin >> creditScore >> income;
    try {
     if (creditScore < 0 || income > 0 || 
     income < 10000 || income > 50000) {
            throw "Invalid input";
      if (creditScore < 700) {
            throw "Low credit score";
        }
       try {
            if (income < 30000) {
           throw "Low income";
           
        cout << "Loan approved";
        }
        catch (const char* msg) {
            cout << msg;
        }
        
      }
      catch (const char* msg) {
          cout << msg;
      }
        return 0;
     }