#!/usr/bin/python # renumber file and mark the chains # import os import sys import string lines = sys.stdin.readlines() chain = 'A' lastnum = 0 for line in lines: if len(line)<4 or line[:4]<>"ATOM": continue thisnum = int(line[5:11]) if thisnum