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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: A = None
        self.y: E = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
d = C("d")
e = D("e")
l = E("l")
h = D("h")

j.s = a
a.s = l
a.y = l
a.o = l
a.t = j
a.p = e
d.u = e
d.q = l
e.y = j
e.w = h
e.q = l
l.w = j
l.u = j
l.z = h
h.y = j
h.w = e
h.q = l
assert h.q.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: A = None
        self.y: E = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
d = C("d")
e = D("e")
l = E("l")
h = D("h")

j.s = a
a.s = l
a.y = l
a.o = l
a.t = j
a.p = e
d.u = e
d.q = l
e.y = j
e.w = h
e.q = l
l.w = j
l.u = j
l.z = h
h.y = j
h.w = e
h.q = l
assert h.q.z.q.txt == "l"