import java.io.*; import java.util.*; import java.text.*; public class A_j { static DataInputStream in = new DataInputStream(System.in); static String line = ""; static MyPair [] pairs = new MyPair[21]; public static void main(String [] args) { int [] ch = new int [3]; int [] back = new int[7]; for(int i=0; i<21; i++) pairs[i] = new MyPair(); try { line = in.readLine(); } catch (IOException ioe) {} StringTokenizer str = new StringTokenizer(line); ch[0] = Integer.parseInt(str.nextToken()); ch[1] = Integer.parseInt(str.nextToken()); ch[2] = Integer.parseInt(str.nextToken()); try { line = in.readLine(); } catch (IOException ioe) {} str = new StringTokenizer(line); int k=0; for(int i=0; i<7; i++) { pairs[k].f = 0; pairs[k+1].f = 1; pairs[k+2].f = 2; back[i] = Integer.parseInt(str.nextToken()); pairs[k+1].b = pairs[k+2].b = pairs[k].b = i; k += 3; } // bubble sort, what the hey for(int i=0; i<20; i++) { for(int j=0; j<20; j++) { if (ch[pairs[j].f]*back[pairs[j+1].b] > ch[pairs[j+1].f]*back[pairs[j].b]) { MyPair temp = pairs[j]; pairs[j] = pairs[j+1]; pairs[j+1] = temp; } } } DecimalFormat df = new DecimalFormat("0.00"); for(int i=0; i<21; i++) { System.out.println(df.format((float)ch[pairs[i].f]/back[pairs[i].b]) + " " + (pairs[i].f+1) + " " + (pairs[i].b+1)); } } } class MyPair { public int f, b; }