def METHOD_NAME(lines):
  gamma = lines["gamma"]["match"]
  alpha = lines["alpha"]["match"]
  beta = lines["beta"]["match"]
  for acell,bcell in gamma:
    for al_bcell,al_ccell in alpha:
      if al_bcell != bcell: continue
      for be_ccell, be_acell in beta:
        if be_ccell != al_ccell: continue
        if be_acell != acell: continue
        return acell, al_bcell, be_ccell
  return None