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 = 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 <= 90.0:
        mode = 2

    elif pos > 90.3 and pos <= 91.6:
        mode = 3
    elif pos > 91.8:
        mode = 3
        
    if mode >= 1:
#        print pos, band[i,mode]
        print band[i,mode], factor*vel[i,mode]**2



    
