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

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

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

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

j.x = l
j.t = n
j.y = n
c.z = g
c.p = b
n.r = c
n.u = f
g.x = l
g.t = n
g.y = f
b.r = a
b.u = n
f.r = c
f.u = b
e.x = j
e.t = b
e.y = h
a.z = l
a.p = h
h.r = a
h.u = b
l.x = j
l.t = h
l.y = n
assert a.p.u.u.u.u.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

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

j.x = l
j.t = n
j.y = n
c.z = g
c.p = b
n.r = c
n.u = f
g.x = l
g.t = n
g.y = f
b.r = a
b.u = n
f.r = c
f.u = b
e.x = j
e.t = b
e.y = h
a.z = l
a.p = h
h.r = a
h.u = b
l.x = j
l.t = h
l.y = n
assert a.p.u.u.u.u.r.z.txt == "l"