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

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

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

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

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

g = A("g")
l = B("l")
b = C("b")
m = D("m")
i = E("i")
h = D("h")
c = C("c")
k = B("k")
a = C("a")

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

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

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

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

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

g = A("g")
l = B("l")
b = C("b")
m = D("m")
i = E("i")
h = D("h")
c = C("c")
k = B("k")
a = C("a")

g.t = m
g.v = c
g.r = c
g.y = k
l.v = m
l.u = k
l.q = k
l.x = k
b.w = m
b.r = c
b.y = l
b.o = i
m.z = l
i.t = b
i.z = b
h.z = k
c.w = h
c.r = b
c.y = l
c.o = i
k.v = m
k.u = l
k.q = l
k.x = l
a.w = m
a.r = c
a.y = l
a.o = i
assert l.q.v.z.x.x.x.u.v.z.txt == "l"