class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: B = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

n = A("n")
e = B("e")
j = C("j")
m = D("m")
c = E("c")

n.t = j
n.z = e
n.w = e
e.w = n
e.t = n
j.v = n
j.w = c
m.r = n
m.o = c
m.v = j
c.t = j
c.u = j
c.s = e
c.y = n
assert m.o.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: B = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

n = A("n")
e = B("e")
j = C("j")
m = D("m")
c = E("c")

n.t = j
n.z = e
n.w = e
e.w = n
e.t = n
j.v = n
j.w = c
m.r = n
m.o = c
m.v = j
c.t = j
c.u = j
c.s = e
c.y = n
assert m.o.y.t.txt == "j"