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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: A = None
        self.s: E = None
        self.r: C = None
        self.txt = txt

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

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

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

f.y = l
a.r = f
a.v = e
e.w = j
e.o = f
e.s = c
e.r = g
d.u = c
d.o = c
d.s = a
d.z = a
j.q = a
c.q = a
g.w = j
g.s = j
g.o = f
g.r = e
l.u = c
l.s = a
l.z = a
l.o = j
assert a.r.y.u.q.r.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: A = None
        self.s: E = None
        self.r: C = None
        self.txt = txt

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

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

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

f.y = l
a.r = f
a.v = e
e.w = j
e.o = f
e.s = c
e.r = g
d.u = c
d.o = c
d.s = a
d.z = a
j.q = a
c.q = a
g.w = j
g.s = j
g.o = f
g.r = e
l.u = c
l.s = a
l.z = a
l.o = j
assert a.r.y.u.q.r.y.o.txt == "j"