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

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

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

a = A("a")
l = B("l")
b = C("b")
n = A("n")
k = B("k")
f = B("f")
e = B("e")
m = B("m")

a.t = n
l.y = b
l.z = b
l.w = n
b.y = n
n.t = a
k.y = b
k.z = b
k.w = a
f.y = b
f.z = b
f.w = n
e.y = b
e.z = b
e.w = a
m.y = b
m.z = b
m.w = a
assert e.z.y.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

a = A("a")
l = B("l")
b = C("b")
n = A("n")
k = B("k")
f = B("f")
e = B("e")
m = B("m")

a.t = n
l.y = b
l.z = b
l.w = n
b.y = n
n.t = a
k.y = b
k.z = b
k.w = a
f.y = b
f.z = b
f.w = n
e.y = b
e.z = b
e.w = a
m.y = b
m.z = b
m.w = a
assert e.z.y.t.t.t.t.t.txt == "a"