import numpy as np
import sys

band = np.loadtxt(sys.argv[1])
vel = np.loadtxt(sys.argv[2])

nrow, ncol = np.shape(band)

#print nrow, ncol

#vel_ref = 3832.891166 
vel_ref = 4100.945485

factor = 1.0 / vel_ref**2

#print factor

nband = ncol - 1

#vec = np.zeros((nrow, nband, 2))


for i in range(nrow):

    pos = 100 * band[i,0] / 0.151768

    mode = -1

    if pos <= 72.75:
        mode = 3

    elif pos > 72.95 and pos <= 77.35:
        mode = 5
    elif pos > 77.55 and pos <= 89.75:
        mode = 7
    elif pos > 89.85 and pos <= 90.05:
        mode = 8
    elif pos > 90.15 and pos <= 90.45:
        mode = 9
    elif pos > 90.65:
        mode = 11
        
    if mode >= 1:
#        print pos, band[i,mode]
        print band[i,mode], factor*vel[i,mode]**2



    
