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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

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

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

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

e.v = l
e.t = n
e.r = n
e.q = g
b.q = l
n.t = g
n.w = g
n.x = l
n.z = m
l.u = m
l.x = m
l.q = n
l.z = b
l.s = h
m.t = b
m.z = l
c.q = l
h.v = l
h.t = n
h.r = n
h.q = g
g.v = l
g.t = n
g.r = n
g.q = e
assert b.q.s.t.z.t.q.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: C = None
        self.q: A = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

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

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

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

e.v = l
e.t = n
e.r = n
e.q = g
b.q = l
n.t = g
n.w = g
n.x = l
n.z = m
l.u = m
l.x = m
l.q = n
l.z = b
l.s = h
m.t = b
m.z = l
c.q = l
h.v = l
h.t = n
h.r = n
h.q = g
g.v = l
g.t = n
g.r = n
g.q = e
assert b.q.s.t.z.t.q.q.x.txt == "l"