#!/usr/bin/env python

# Discretize vector of real values
# Outputs n-highest dimensions 
# on/off depending on threshold m

import sys
import numpy

def main():
  n = int(sys.argv[1])
  if len(sys.argv) < 3:
    m = 0.5
  else:
    m = float(sys.argv[2])
  for line in sys.stdin:
      vals = numpy.array([ float(v) for v in line.split() ], dtype='float')
      ixs = numpy.argsort(vals)[::-1] # reversed view on sort indices
      print " ".join([ "%d:%s" % (i, "T" if vals[i] > m else "F") for i in ixs[0:n] ])

if __name__ == "__main__":
  main()
