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

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

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

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

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

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

l.y = j
l.q = h
c.q = h
c.z = l
h.y = l
h.o = j
h.t = e
h.w = e
e.t = h
j.o = h
j.q = h
j.z = h
j.s = e
j.r = c
assert j.r.q.w.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

l.y = j
l.q = h
c.q = h
c.z = l
h.y = l
h.o = j
h.t = e
h.w = e
e.t = h
j.o = h
j.q = h
j.z = h
j.s = e
j.r = c
assert j.r.q.w.t.y.txt == "l"