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

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

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

d = A("d")
k = B("k")
h = C("h")
n = B("n")
a = C("a")
e = B("e")
g = B("g")
b = B("b")
c = A("c")

d.t = h
d.u = h
d.w = c
k.x = c
k.q = a
k.u = g
h.r = c
h.z = d
n.x = d
n.q = a
n.u = e
a.r = c
a.z = c
e.x = c
e.q = h
e.u = k
g.x = d
g.q = a
g.u = k
b.x = c
b.q = a
b.u = e
c.t = a
c.u = h
c.w = d
assert c.u.z.u.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.w: A = None
        self.txt = txt

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

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

d = A("d")
k = B("k")
h = C("h")
n = B("n")
a = C("a")
e = B("e")
g = B("g")
b = B("b")
c = A("c")

d.t = h
d.u = h
d.w = c
k.x = c
k.q = a
k.u = g
h.r = c
h.z = d
n.x = d
n.q = a
n.u = e
a.r = c
a.z = c
e.x = c
e.q = h
e.u = k
g.x = d
g.q = a
g.u = k
b.x = c
b.q = a
b.u = e
c.t = a
c.u = h
c.w = d
assert c.u.z.u.r.t.txt == "a"