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

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

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

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

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

b = A("b")
h = B("h")
e = C("e")
a = D("a")
g = E("g")
f = A("f")
l = E("l")
c = D("c")
k = B("k")
j = A("j")

b.t = g
h.x = j
e.t = b
e.x = g
a.z = e
a.w = e
a.q = c
a.p = b
a.v = k
g.u = e
g.x = e
g.v = l
g.y = b
f.t = g
l.u = e
l.x = e
l.v = g
l.y = f
c.z = e
c.w = e
c.q = a
c.p = j
c.v = k
k.x = j
j.t = g
assert k.x.t.x.x.x.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

b = A("b")
h = B("h")
e = C("e")
a = D("a")
g = E("g")
f = A("f")
l = E("l")
c = D("c")
k = B("k")
j = A("j")

b.t = g
h.x = j
e.t = b
e.x = g
a.z = e
a.w = e
a.q = c
a.p = b
a.v = k
g.u = e
g.x = e
g.v = l
g.y = b
f.t = g
l.u = e
l.x = e
l.v = g
l.y = f
c.z = e
c.w = e
c.q = a
c.p = j
c.v = k
k.x = j
j.t = g
assert k.x.t.x.x.x.x.v.txt == "l"