/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		userInput ui = new userInput(new Scanner(System.in));
		int num = ui.thisMethod();
		System.out.println("returned "+ num);
	}
}

class userInput{
	Scanner sc;

	public userInput(Scanner scanner){
		sc = scanner;
	}
	
	public int thisMethod(){
		int n = -1; // this is to just set the variable to something
		System.out.println("Question to user");
		try{
	    	n = Integer.parseInt(sc.nextLine());
	    	if (n < 0){
	    		//i want specificly want input over 0
	    		n = thisMethod();
	    	}
	    	if (n > 3){
	    		//8 is a random number, but the number is linked to an array length, so the index needs to be lower than 3
	    		n = thisMethod();
	    	}
		} catch (NumberFormatException e){
			n = thisMethod();
		}
		return n;
	}
}