class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

l.o = e
l.q = i
i.t = e
i.y = e
g.u = i
g.z = i
e.z = g
h.s = b
h.p = n
h.y = n
h.v = i
h.x = e
n.u = i
n.z = i
b.s = h
b.p = g
b.v = i
b.y = n
b.x = e
assert h.v.y.z.u.y.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

l.o = e
l.q = i
i.t = e
i.y = e
g.u = i
g.z = i
e.z = g
h.s = b
h.p = n
h.y = n
h.v = i
h.x = e
n.u = i
n.z = i
b.s = h
b.p = g
b.v = i
b.y = n
b.x = e
assert h.v.y.z.u.y.z.u.txt == "i"