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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.u: D = None
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

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

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

k.p = f
d.x = j
j.t = g
j.r = f
j.u = l
j.s = k
j.p = a
c.w = a
c.p = f
c.q = k
c.z = k
c.t = l
a.p = l
a.r = k
g.x = f
f.t = d
f.r = j
f.u = c
f.s = k
f.p = a
l.w = a
l.p = j
l.q = k
l.z = k
l.t = c
assert j.r.s.p.u.t.z.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.u: D = None
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

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

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

k.p = f
d.x = j
j.t = g
j.r = f
j.u = l
j.s = k
j.p = a
c.w = a
c.p = f
c.q = k
c.z = k
c.t = l
a.p = l
a.r = k
g.x = f
f.t = d
f.r = j
f.u = c
f.s = k
f.p = a
l.w = a
l.p = j
l.q = k
l.z = k
l.t = c
assert j.r.s.p.u.t.z.p.r.txt == "j"