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

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

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

a = A("a")
d = B("d")
g = C("g")
c = A("c")
n = C("n")
m = A("m")
b = B("b")
k = A("k")
f = B("f")
j = B("j")

a.z = k
a.o = c
a.t = c
d.t = j
d.u = g
g.x = k
g.y = f
c.z = a
c.o = m
c.t = k
n.x = k
n.y = d
m.z = c
m.o = a
m.t = k
b.t = d
b.u = n
k.z = a
k.o = c
k.t = m
f.t = d
f.u = n
j.t = d
j.u = g
assert j.t.t.t.t.u.y.t.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

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

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

a = A("a")
d = B("d")
g = C("g")
c = A("c")
n = C("n")
m = A("m")
b = B("b")
k = A("k")
f = B("f")
j = B("j")

a.z = k
a.o = c
a.t = c
d.t = j
d.u = g
g.x = k
g.y = f
c.z = a
c.o = m
c.t = k
n.x = k
n.y = d
m.z = c
m.o = a
m.t = k
b.t = d
b.u = n
k.z = a
k.o = c
k.t = m
f.t = d
f.u = n
j.t = d
j.u = g
assert j.t.t.t.t.u.y.t.u.y.txt == "f"