import java.util.*;
import java.io.*;

import static java.lang.System.*;

public class Emails {
    public static void main(String[] args) throws IOException {
        Scanner input = new Scanner(new File("emails.dat"));
        int times = input.nextInt();
        input.nextLine();

        while (times-->0) {
            String email = input.nextLine();
            if (email.matches("[A-Za-z0-9_]+@[A-Za-z0-9_]+\\.(com|net|org)")) { // *MAGIC*
                out.println("Valid");                                           // (read the regex tutorial)
            } else {
                out.println("Invalid");
            }
        }
    }
}

results matching ""

    No results matching ""