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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.txt = txt

e = A("e")
h = B("h")
n = C("n")
l = D("l")
b = E("b")
c = C("c")

e.y = b
e.t = n
e.z = n
h.u = l
h.w = e
h.x = n
h.s = c
n.t = h
l.v = b
b.q = c
b.z = h
c.t = h
assert n.t.x.t.x.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.txt = txt

e = A("e")
h = B("h")
n = C("n")
l = D("l")
b = E("b")
c = C("c")

e.y = b
e.t = n
e.z = n
h.u = l
h.w = e
h.x = n
h.s = c
n.t = h
l.v = b
b.q = c
b.z = h
c.t = h
assert n.t.x.t.x.t.w.txt == "e"