class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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