class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: E = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

b.v = l
b.z = f
b.t = c
b.w = d
i.z = d
i.w = m
i.u = m
d.r = i
d.z = l
d.q = k
d.s = k
c.q = k
f.u = i
f.y = d
f.s = k
f.v = m
l.r = i
l.z = d
l.q = k
l.s = k
m.v = d
m.z = f
m.t = c
m.w = l
k.q = c
assert b.w.s.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: E = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

b.v = l
b.z = f
b.t = c
b.w = d
i.z = d
i.w = m
i.u = m
d.r = i
d.z = l
d.q = k
d.s = k
c.q = k
f.u = i
f.y = d
f.s = k
f.v = m
l.r = i
l.z = d
l.q = k
l.s = k
m.v = d
m.z = f
m.t = c
m.w = l
k.q = c
assert b.w.s.q.q.q.txt == "c"