#!/usr/bin/env python

import os,sys
pwd = os.path.dirname(__file__) + "/lib"
sys.path.append(pwd)
import common

json=common.parse()
try:
  if json[u'userCtx'][u'name'] and json[u'userCtx'][u'roles']:
    print json[u'userCtx'][u'name']
    sys.stdout.write('\n'.join(json[u'userCtx'][u'roles']))
  else:
    sys.exit(1)
except Exception:
  sys.exit(1)
