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

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

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

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

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

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

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

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

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

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

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

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

c.v = j
c.u = f
d.z = f
d.w = j
d.y = j
d.q = j
d.u = c
f.z = j
f.u = d
f.r = c
j.w = f
j.t = c
l.p = j
l.q = j
b.z = f
b.w = j
b.y = j
b.q = j
b.u = c
assert l.q.w.z.w.r.txt == "c"