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

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

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

j = A("j")
a = B("a")
k = C("k")
b = B("b")
g = C("g")
m = A("m")
c = B("c")
l = B("l")

j.z = g
j.u = a
j.t = a
a.u = b
a.s = c
a.v = g
k.y = g
b.u = c
b.s = a
b.v = k
g.y = k
m.z = k
m.u = a
m.t = b
c.u = b
c.s = a
c.v = k
l.u = b
l.s = a
l.v = g
assert j.z.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.t: B = None
        self.txt = txt

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

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

j = A("j")
a = B("a")
k = C("k")
b = B("b")
g = C("g")
m = A("m")
c = B("c")
l = B("l")

j.z = g
j.u = a
j.t = a
a.u = b
a.s = c
a.v = g
k.y = g
b.u = c
b.s = a
b.v = k
g.y = k
m.z = k
m.u = a
m.t = b
c.u = b
c.s = a
c.v = k
l.u = b
l.s = a
l.v = g
assert j.z.y.y.y.y.y.txt == "k"