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

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

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

j = A("j")
i = B("i")
l = C("l")
b = A("b")
m = B("m")
c = B("c")
h = B("h")

j.w = b
j.p = b
j.q = h
i.u = j
i.t = b
i.z = m
l.u = c
l.z = b
b.w = j
b.p = j
b.q = h
m.u = b
m.t = b
m.z = h
c.u = b
c.t = j
c.z = h
h.u = j
h.t = b
h.z = i
assert l.z.p.q.t.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: B = None
        self.p: A = None
        self.txt = txt

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

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

j = A("j")
i = B("i")
l = C("l")
b = A("b")
m = B("m")
c = B("c")
h = B("h")

j.w = b
j.p = b
j.q = h
i.u = j
i.t = b
i.z = m
l.u = c
l.z = b
b.w = j
b.p = j
b.q = h
m.u = b
m.t = b
m.z = h
c.u = b
c.t = j
c.z = h
h.u = j
h.t = b
h.z = i
assert l.z.p.q.t.q.u.txt == "j"