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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.w: E = None
        self.txt = txt

l = A("l")
i = B("i")
b = C("b")
m = D("m")
n = E("n")
d = A("d")
h = E("h")
g = B("g")

l.z = i
l.r = d
l.v = b
i.y = h
b.t = m
b.y = m
b.w = m
b.u = n
m.u = g
m.z = b
n.x = d
n.u = g
n.w = h
d.z = i
d.r = l
d.v = b
h.x = l
h.u = g
h.w = n
g.y = n
assert h.w.u.y.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: A = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.w: E = None
        self.txt = txt

l = A("l")
i = B("i")
b = C("b")
m = D("m")
n = E("n")
d = A("d")
h = E("h")
g = B("g")

l.z = i
l.r = d
l.v = b
i.y = h
b.t = m
b.y = m
b.w = m
b.u = n
m.u = g
m.z = b
n.x = d
n.u = g
n.w = h
d.z = i
d.r = l
d.v = b
h.x = l
h.u = g
h.w = n
g.y = n
assert h.w.u.y.x.v.txt == "b"