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

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

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

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

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

f = A("f")
e = B("e")
m = C("m")
c = D("c")
l = E("l")
h = D("h")
b = A("b")

f.y = b
f.z = l
e.v = b
e.u = m
m.t = e
m.s = h
m.u = l
m.q = l
c.p = e
c.r = m
c.x = m
l.z = h
l.w = m
h.p = e
h.r = m
h.x = m
b.y = f
b.z = l
assert c.p.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

f = A("f")
e = B("e")
m = C("m")
c = D("c")
l = E("l")
h = D("h")
b = A("b")

f.y = b
f.z = l
e.v = b
e.u = m
m.t = e
m.s = h
m.u = l
m.q = l
c.p = e
c.r = m
c.x = m
l.z = h
l.w = m
h.p = e
h.r = m
h.x = m
b.y = f
b.z = l
assert c.p.v.z.txt == "l"