#!/usr/bin/env python
import os
import time
import random

def sum(key):
	sum = 0
	for c in key:
		sum += ord(c)
	return sum

while True:
	keyPluggedIn = os.path.isdir("/Volumes/ESD-USB")
	keyHasPassword = os.path.exists("/Volumes/ESD-USB/key.txt")
	if keyPluggedIn and keyHasPassword and sum(os.popen("cat /Volumes/ESD-USB/key.txt").read().rstrip()) == 867:
		print os.popen("clear").read().rstrip()
		print "User: Admin"
		print "Status: Authorized"
		while True:
			print os.popen(raw_input("admin@system$ ")).read().rstrip()
	else:
		print os.popen("clear").read().rstrip()
		print "User: Guest"
		print "Status: Unauthorized"
		time.sleep(0.5)