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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

g = A("g")
e = B("e")
n = C("n")
i = D("i")
b = E("b")
c = D("c")
l = E("l")
j = E("j")
a = C("a")

g.r = e
g.p = a
e.t = i
n.q = e
n.v = g
i.s = g
b.z = a
b.v = i
b.t = g
b.u = g
b.x = c
c.s = g
l.z = n
l.v = c
l.t = g
l.u = g
l.x = i
j.z = a
j.v = i
j.t = g
j.u = g
j.x = c
a.q = e
a.v = g
assert l.x.s.p.q.t.s.r.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

g = A("g")
e = B("e")
n = C("n")
i = D("i")
b = E("b")
c = D("c")
l = E("l")
j = E("j")
a = C("a")

g.r = e
g.p = a
e.t = i
n.q = e
n.v = g
i.s = g
b.z = a
b.v = i
b.t = g
b.u = g
b.x = c
c.s = g
l.z = n
l.v = c
l.t = g
l.u = g
l.x = i
j.z = a
j.v = i
j.t = g
j.u = g
j.x = c
a.q = e
a.v = g
assert l.x.s.p.q.t.s.r.t.s.txt == "g"