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

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

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

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

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

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

b.x = c
b.z = d
b.u = k
d.y = b
d.s = g
d.u = g
j.z = e
j.o = b
j.q = k
j.s = d
j.x = d
e.x = l
c.q = j
l.x = c
l.z = f
l.u = j
g.y = b
g.s = d
g.u = d
k.z = e
k.o = b
k.q = j
k.s = f
k.x = d
f.y = b
f.s = g
f.u = g
assert j.o.z.u.y.u.o.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

b.x = c
b.z = d
b.u = k
d.y = b
d.s = g
d.u = g
j.z = e
j.o = b
j.q = k
j.s = d
j.x = d
e.x = l
c.q = j
l.x = c
l.z = f
l.u = j
g.y = b
g.s = d
g.u = d
k.z = e
k.o = b
k.q = j
k.s = f
k.x = d
f.y = b
f.s = g
f.u = g
assert j.o.z.u.y.u.o.z.y.txt == "b"