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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.z: D = None
        self.y: A = None
        self.q: A = None
        self.txt = txt

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

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

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

i = A("i")
l = B("l")
c = C("c")
m = D("m")
b = E("b")
j = C("j")
h = E("h")
g = E("g")

i.v = m
i.p = j
i.x = c
l.s = m
l.x = m
l.z = m
l.y = i
l.q = i
c.w = m
m.p = h
m.v = h
b.z = m
j.w = m
h.z = m
g.z = m
assert i.p.w.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: D = None
        self.z: D = None
        self.y: A = None
        self.q: A = None
        self.txt = txt

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

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

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

i = A("i")
l = B("l")
c = C("c")
m = D("m")
b = E("b")
j = C("j")
h = E("h")
g = E("g")

i.v = m
i.p = j
i.x = c
l.s = m
l.x = m
l.z = m
l.y = i
l.q = i
c.w = m
m.p = h
m.v = h
b.z = m
j.w = m
h.z = m
g.z = m
assert i.p.w.v.z.txt == "m"