Rating:

Each char is being encrypted separately and saved in the output. Since we have the public key, simply build a dictionnary for all printables chars and print the flag like such:

```
d = {}
for i in string.printable:
d[pow(ord(i),e,n)] = i

print ''.join([d[int(i)] for i in open('output').split('\n')])
```