#include <iostream>
#include <string>

enum { INVALID    = 0x00,
       IS_NUMBER  = 0x01,
       IS_UPPER   = 0x02,
       IS_LOWER   = 0x04,
};

using namespace std;

int checkValidPassword(string password)
{
  int checkPassword = 0;

  if (password.length() < 6) return INVALID;
                             
  for (int i = 0; i < password.length(); i++) {
    if (password[i] >= '0' && password[i] <= '9') {
      checkPassword |= IS_NUMBER;
    } else if (password[i] >= 'A' && password[i] <= 'Z') {
      checkPassword |= IS_UPPER;
    } else {
      checkPassword |= IS_LOWER;
    }
  }

  return checkPassword;
}


int main()
{
  string password;

  cin >> password;

  int checkPass = checkValidPassword(password);

  if (checkPass == 0x07) {
    cout << "VALID" << endl;
  } else {
    cout << "INVALID" << endl;
  }
}

