import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double x1=input.nextDouble();
double y1=input.nextDouble();
double w1=input.nextDouble();
double h1=input.nextDouble();
double x2=input.nextDouble();
double y2=input.nextDouble();
double w2=input.nextDouble();
double h2=input.nextDouble();
double length1=Math.pow((x1-x2)*(x1-x2),0.5);
double length2=Math.pow((y1-y2)*(y1-y2),0.5);
if(h1+h2<length1|w1+w2<length2)
System.out.println("outside");
else if(h1>length1+h2&w1>length2+w2)
System.out.println("inside");
else
System.out.println("attach");
}
}
이렇게 하면 안되나요?