while True: try: st=input() if len(st)<8: print('NG')  ...