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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: E = None
        self.y: E = None
        self.txt = txt

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

a.x = m
a.o = m
a.t = g
g.r = l
g.v = d
l.z = g
l.r = n
l.w = e
d.t = g
d.p = c
e.q = l
e.v = c
e.y = c
i.t = n
i.p = c
c.q = l
c.v = e
c.y = e
h.r = l
h.v = d
n.r = l
n.v = i
m.x = a
m.o = a
m.t = g
assert e.q.z.v.p.q.w.q.r.r.txt == "l"