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

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

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

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

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

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

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

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

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

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

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

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

i.q = e
i.v = l
e.x = l
e.z = l
e.q = l
g.s = n
g.p = h
g.z = l
l.w = i
l.v = e
h.o = l
h.t = l
h.r = e
n.s = j
n.p = h
n.z = l
j.s = g
j.p = h
j.z = l
assert h.t.v.q.v.q.txt == "l"