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

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

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

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

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

j = A("j")
e = B("e")
d = C("d")
i = D("i")
b = E("b")

j.q = d
j.r = d
j.p = b
j.y = b
j.z = i
e.v = b
e.y = j
e.s = d
e.t = d
e.z = i
d.x = e
d.t = e
d.o = j
d.q = b
d.z = b
i.r = b
b.p = d
b.t = e
b.x = e
assert i.r.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.y: E = None
        self.z: D = None
        self.r: C = None
        self.txt = txt

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

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

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

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

j = A("j")
e = B("e")
d = C("d")
i = D("i")
b = E("b")

j.q = d
j.r = d
j.p = b
j.y = b
j.z = i
e.v = b
e.y = j
e.s = d
e.t = d
e.z = i
d.x = e
d.t = e
d.o = j
d.q = b
d.z = b
i.r = b
b.p = d
b.t = e
b.x = e
assert i.r.p.q.txt == "b"