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

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

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

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

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

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

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

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

c.z = d
c.t = h
c.s = a
d.t = c
d.x = n
h.u = f
h.z = g
h.t = j
g.u = f
g.z = h
g.t = l
j.u = d
j.z = h
j.t = l
l.u = d
l.z = j
l.t = h
a.z = d
a.t = g
a.s = c
n.t = c
n.x = d
f.t = a
f.x = d
e.z = f
e.t = j
e.s = a
assert e.t.u.t.s.t.z.t.t.txt == "l"