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

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

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

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

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

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

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

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

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

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

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

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

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