import java.io.*;

public class Euler {
    public static void main(String args[]) {
	double h, x, y;
	// 始点
	x=1.0; y=1.0;
	
	// Euler法
	h = 0.1;
	Euler dy = new Euler();
	
	for(int i=0; i<=5; i++) {
	    
	    String fn = new String();
	    fn = "Magnetic_line" + String.valueOf(i) + ".txt";
	    
	    while(y>0) {
		y = y + dy.f(x,y) * h;
		
		try {
		    PrintWriter pw = new PrintWriter
			(new BufferedWriter(new FileWriter(fn,true)));
		    
		    pw.println(x + " " + y);
		    pw.close();
		}
		catch(IOException e) {
		    System.out.println("入出力エラー");
		}
		x = x + h;
	    }
	    x=1.0; y =1.0+(double)i;
	}
    }
    
    // f(x,y)
    double f(double x,double y) {
	double f = 0.0;
	f = y/x - (x*x+y*y)/(3*x*y);
	return f;
    }
}
