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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: B = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: B = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

j.v = d
j.p = a
j.t = a
j.y = a
d.x = a
d.u = a
d.w = b
d.y = j
l.q = j
l.t = b
l.y = c
e.o = a
e.q = c
a.p = j
a.z = l
a.r = e
a.s = e
a.y = c
b.x = a
b.u = a
b.w = d
b.y = j
c.o = a
c.q = e
assert d.y.t.s.o.y.txt == "c"