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

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

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

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

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

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

i.r = k
f.u = e
f.v = d
f.o = c
k.v = c
k.u = c
k.r = j
k.q = j
c.u = i
c.s = j
c.r = e
c.z = d
b.r = f
b.w = d
d.r = f
d.w = b
j.v = l
j.u = l
j.r = k
j.q = k
e.u = i
e.s = k
e.r = c
e.z = d
l.u = i
l.s = j
l.r = e
l.z = d
assert j.v.u.r.v.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

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

i.r = k
f.u = e
f.v = d
f.o = c
k.v = c
k.u = c
k.r = j
k.q = j
c.u = i
c.s = j
c.r = e
c.z = d
b.r = f
b.w = d
d.r = f
d.w = b
j.v = l
j.u = l
j.r = k
j.q = k
e.u = i
e.s = k
e.r = c
e.z = d
l.u = i
l.s = j
l.r = e
l.z = d
assert j.v.u.r.v.z.w.txt == "b"