class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.t: B = None
        self.r: D = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: E = None
        self.y: D = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.z: E = None
        self.q: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

n = A("n")
b = B("b")
i = C("i")
f = D("f")
h = E("h")

n.o = b
n.t = b
n.v = b
n.z = i
n.r = f
b.r = i
b.p = i
b.o = h
b.y = f
i.s = n
f.y = i
f.x = i
f.q = i
f.z = h
f.w = n
h.z = n
assert i.s.z.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.t: B = None
        self.r: D = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: E = None
        self.y: D = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.z: E = None
        self.q: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

n = A("n")
b = B("b")
i = C("i")
f = D("f")
h = E("h")

n.o = b
n.t = b
n.v = b
n.z = i
n.r = f
b.r = i
b.p = i
b.o = h
b.y = f
i.s = n
f.y = i
f.x = i
f.q = i
f.z = h
f.w = n
h.z = n
assert i.s.z.s.z.txt == "i"