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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: D = None
        self.x: A = None
        self.w: E = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.v: C = None
        self.y: E = None
        self.txt = txt

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

i = A("i")
c = B("c")
j = C("j")
g = D("g")
l = E("l")
k = E("k")
f = D("f")

i.v = c
i.z = c
i.r = g
c.p = j
c.t = j
c.r = f
c.x = i
c.w = l
j.x = l
j.q = g
j.s = c
g.w = j
g.v = j
g.x = k
g.y = k
l.z = f
k.z = g
f.w = j
f.v = j
f.x = k
f.y = l
assert i.v.r.x.z.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: D = None
        self.x: A = None
        self.w: E = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.v: C = None
        self.y: E = None
        self.txt = txt

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

i = A("i")
c = B("c")
j = C("j")
g = D("g")
l = E("l")
k = E("k")
f = D("f")

i.v = c
i.z = c
i.r = g
c.p = j
c.t = j
c.r = f
c.x = i
c.w = l
j.x = l
j.q = g
j.s = c
g.w = j
g.v = j
g.x = k
g.y = k
l.z = f
k.z = g
f.w = j
f.v = j
f.x = k
f.y = l
assert i.v.r.x.z.v.x.txt == "l"