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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: A = None
        self.w: B = None
        self.p: B = None
        self.s: A = None
        self.txt = txt

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

j = A("j")
i = B("i")
d = C("d")
f = D("f")
l = E("l")

j.y = d
j.t = d
j.x = l
i.q = d
i.t = l
i.w = l
d.o = i
d.z = f
d.t = f
d.x = l
f.y = d
f.q = j
f.s = j
f.w = i
f.p = i
l.s = i
assert j.y.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: A = None
        self.w: B = None
        self.p: B = None
        self.s: A = None
        self.txt = txt

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

j = A("j")
i = B("i")
d = C("d")
f = D("f")
l = E("l")

j.y = d
j.t = d
j.x = l
i.q = d
i.t = l
i.w = l
d.o = i
d.z = f
d.t = f
d.x = l
f.y = d
f.q = j
f.s = j
f.w = i
f.p = i
l.s = i
assert j.y.o.q.txt == "d"